diff --git a/index.js b/index.js index 28d3cb5..c441631 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ const path = require('path'); +const slug = require('slug'); const core = require('@actions/core'); const exec = require('@actions/exec'); const GhostAdminApi = require('@tryghost/admin-api'); @@ -19,7 +20,7 @@ const GhostAdminApi = require('@tryghost/admin-api'); // Zip file was not provided - zip everything up! if (!zipPath) { - const themeName = core.getInput('theme-name') || require(pkgPath).name; + const themeName = core.getInput('theme-name') || slug(require(pkgPath).name); const themeZip = `${themeName}.zip`; const exclude = core.getInput('exclude') || ''; zipPath = themeZip; diff --git a/package.json b/package.json index d0c8cda..924f586 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@actions/core": "3.0.0", "@actions/exec": "3.0.0", "@tryghost/admin-api": "1.14.4", - "@vercel/ncc": "^0.38.0" + "@vercel/ncc": "^0.38.0", + "slug": "^8.2.2" } } diff --git a/yarn.lock b/yarn.lock index 17d6659..1fdf880 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1605,6 +1605,11 @@ simple-html-tokenizer@^0.5.11: resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.11.tgz#4c5186083c164ba22a7b477b7687ac056ad6b1d9" integrity sha512-C2WEK/Z3HoSFbYq8tI7ni3eOo/NneSPRoPpcM7WdLjFOArFuyXEjAoCdOC3DgMfRyziZQ1hCNR4mrNdWEvD0og== +slug@^8.2.2: + version "8.2.2" + resolved "https://registry.yarnpkg.com/slug/-/slug-8.2.2.tgz#33b019a857a11fc4773c1e9a9f60e3da651a9e5d" + integrity sha512-5ByW6qXqPeG0Tmlkh24JhdXhvQsbaJSjVr3GgGxUV0BSskZKKBZZfFWxezap8+fh1vxBN9GVbqI1V6nqAFxlBg== + snake-case@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"