diff --git a/README.md b/README.md index af7eb41..99e7b2a 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ Following inputs can be used as `step.with` keys |-----------------|---------|-------------------------------------------------------------------| | `repo` | String | GitHub repository where assets will be deployed (default current) | | `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) | -| `build_dir` | String | Build directory to deploy **required** | -| `comitter_name` | String | Commit author's name (default [GITHUB_ACTOR](https://help.github.com/en/github/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables))| -| `comitter_email`| String | Commit author's email (default `GITHUB_ACTOR@users.noreply.github.com`)| +| `build_dir` | String | Build directory to deploy (**required**) | +| `commit_name` | String | Commit author's name (default [GITHUB_ACTOR](https://help.github.com/en/github/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables) or `github-actions`) | +| `commit_email` | String | Commit author's email (default `@users.noreply.github.com`) | | `commit_message`| String | Commit message (default `Deploy to GitHub pages`) | ### environment variables diff --git a/action.yml b/action.yml index a9f92b9..b8e0860 100644 --- a/action.yml +++ b/action.yml @@ -16,14 +16,11 @@ inputs: description: 'Build directory to deploy' required: true comitter_name: - description: 'Name of the commit author' - default: '' + description: 'Commit author''s name' comitter_email: - description: 'Email of the commit author' - default: '@users.noreply.github.com' + description: 'Commit author''s email' commit_message: - description: 'Commit description' - default: 'Deploy to GitHub pages' + description: 'Commit message' runs: using: 'node12' diff --git a/lib/main.js b/lib/main.js index d11a7c3..bb1c51d 100644 --- a/lib/main.js +++ b/lib/main.js @@ -26,8 +26,8 @@ function run() { const repo = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || ''; const target_branch = core.getInput('target_branch') || 'gh-pages'; const build_dir = core.getInput('build_dir', { required: true }); - const comitter_name = core.getInput('comitter_name') || process.env['GITHUB_ACTOR'] || 'github-actions'; - const comitter_email = core.getInput('comitter_email') || `${comitter_name}@users.noreply.github.com`; + const commit_name = core.getInput('commit_name') || process.env['GITHUB_ACTOR'] || 'github-actions'; + const commit_email = core.getInput('commit_email') || `${commit_name}@users.noreply.github.com`; const commit_message = core.getInput('commit_message') || 'Deploy to GitHub pages'; if (!fs.existsSync(build_dir)) { core.setFailed('⛔️ Build dir does not exist'); @@ -36,8 +36,8 @@ function run() { core.info(`🏃 Deploying ${build_dir} directory to ${target_branch} branch on ${repo} repo`); process.chdir(build_dir); yield exec.exec('git', ['init']); - yield exec.exec('git', ['config', 'user.name', comitter_name]); - yield exec.exec('git', ['config', 'user.email', comitter_email]); + yield exec.exec('git', ['config', 'user.name', commit_name]); + yield exec.exec('git', ['config', 'user.email', commit_email]); try { child_process.execSync('git status --porcelain').toString(); } diff --git a/src/main.ts b/src/main.ts index b9a4f73..7f9d618 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,8 +8,8 @@ async function run() { const repo = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || ''; const target_branch = core.getInput('target_branch') || 'gh-pages'; const build_dir = core.getInput('build_dir', {required: true}); - const comitter_name = core.getInput('comitter_name') || process.env['GITHUB_ACTOR'] || 'github-actions'; - const comitter_email = core.getInput('comitter_email') || `${comitter_name}@users.noreply.github.com`; + const commit_name = core.getInput('commit_name') || process.env['GITHUB_ACTOR'] || 'github-actions'; + const commit_email = core.getInput('commit_email') || `${commit_name}@users.noreply.github.com`; const commit_message = core.getInput('commit_message') || 'Deploy to GitHub pages'; if (!fs.existsSync(build_dir)) { @@ -21,8 +21,8 @@ async function run() { process.chdir(build_dir); await exec.exec('git', ['init']); - await exec.exec('git', ['config', 'user.name', comitter_name]); - await exec.exec('git', ['config', 'user.email', comitter_email]); + await exec.exec('git', ['config', 'user.name', commit_name]); + await exec.exec('git', ['config', 'user.email', commit_email]); try { child_process.execSync('git status --porcelain').toString();