Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add show-summary input #108

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ See [action.yml](action.yml)
# the "subject-digest" parameter be specified. Defaults to false.
push-to-registry:

# Whether to attach a list of generated attestations to the workflow run
# summary page. Defaults to true.
show-summary:

# The GitHub token used to make authenticated API requests. Default is
# ${{ github.token }}
github-token:
Expand Down
1 change: 1 addition & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const defaultInputs: main.RunInputs = {
subjectDigest: '',
subjectPath: '',
pushToRegistry: false,
showSummary: true,
githubToken: '',
privateSigning: false,
batchSize: 50
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ inputs:
the "subject-digest" parameter be specified. Defaults to false.
default: false
required: false
show-summary:
description: >
Whether to attach a list of generated attestations to the workflow run
summary page. Defaults to true.
default: true
required: false
github-token:
description: >
The GitHub token used to make authenticated API requests.
Expand Down
5 changes: 4 additions & 1 deletion dist/index.js

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

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "actions/attest",
"description": "Generate signed attestations for workflow artifacts",
"version": "1.3.3",
"version": "1.4.0",
"author": "",
"private": true,
"homepage": "https://github.com/actions/attest",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const inputs: RunInputs = {
predicate: core.getInput('predicate'),
predicatePath: core.getInput('predicate-path'),
pushToRegistry: core.getBooleanInput('push-to-registry'),
showSummary: core.getBooleanInput('show-summary'),
githubToken: core.getInput('github-token'),
// undocumented -- not part of public interface
privateSigning: ['true', 'True', 'TRUE', '1'].includes(
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type RunInputs = SubjectInputs &
PredicateInputs & {
pushToRegistry: boolean
githubToken: string
showSummary: boolean
privateSigning: boolean
batchSize: number
}
Expand Down Expand Up @@ -96,7 +97,9 @@ export async function run(inputs: RunInputs): Promise<void> {
}
}

logSummary(atts)
if (inputs.showSummary) {
logSummary(atts)
}
} catch (err) {
// Fail the workflow run if an error occurs
core.setFailed(
Expand Down
Loading