Skip to content

Commit

Permalink
add missing commit_verification input to the .help message
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Dec 10, 2024
1 parent 1291dd1 commit 433d9bd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion __tests__/functions/help.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const defaultInputs = {
permissions: ['write', 'admin', 'maintain'],
allow_sha_deployments: false,
checks: 'all',
commit_verification: true,
ignored_checks: [],
enforced_deployment_order: []
}
Expand Down Expand Up @@ -85,6 +86,7 @@ test('successfully calls help with non-defaults', async () => {
allow_sha_deployments: true,
checks: ['test,build,security'],
ignored_checks: ['lint', 'format'],
commit_verification: false,
enforced_deployment_order: []
}

Expand All @@ -95,7 +97,7 @@ test('successfully calls help with non-defaults', async () => {
)
})

test('successfully calls help with non-defaults', async () => {
test('successfully calls help with non-defaults again', async () => {
const inputs = {
trigger: '.deploy',
reaction: 'eyes',
Expand All @@ -121,6 +123,7 @@ test('successfully calls help with non-defaults', async () => {
allow_sha_deployments: false,
checks: 'required',
ignored_checks: ['lint'],
commit_verification: false,
enforced_deployment_order: ['development', 'staging', 'production']
}

Expand Down
8 changes: 8 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/functions/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export async function help(octokit, context, reactionId, inputs) {
required_contexts_message = `There are required contexts designated for this Action`
}

var commit_verification_message = defaultSpecificMessage
if (inputs.commit_verification === true) {
commit_verification_message = `This Action will require that commits have a verified signature before they can be deployed`
} else {
commit_verification_message = `This Action will not require commits to have a verified signature before they can be deployed`
}

var checks_message = defaultSpecificMessage
if (
typeof inputs.checks === 'string' &&
Expand Down Expand Up @@ -207,6 +214,7 @@ export async function help(octokit, context, reactionId, inputs) {
}\` - The GitHub reaction icon to add to the deployment comment when a deployment is triggered
- \`update_branch: ${inputs.update_branch}\` - ${update_branch_message}
- \`outdated_mode: ${inputs.outdated_mode}\`
- \`commit_verification: ${inputs.commit_verification}\` - ${commit_verification_message}
- \`required_contexts: ${
inputs.required_contexts
}\` - ${required_contexts_message}
Expand Down

0 comments on commit 433d9bd

Please sign in to comment.