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 option to suppress job summary #126

Open
Pesa opened this issue Jun 18, 2024 · 3 comments
Open

Add option to suppress job summary #126

Pesa opened this issue Jun 18, 2024 · 3 comments
Labels
feature-request New feature or request

Comments

@Pesa
Copy link

Pesa commented Jun 18, 2024

I'd like to disable the built-in job summary and instead generate my own attestation summary and combine it with the summary that I'm already generating for the job. In order to do this, I'd need to:

  • pass a flag (or env variable) to actions/attest-build-provenance to suppress the generation of the built-in job summary
  • obtain the attestation URL as an output of actions/attest-build-provenance (AFAICS the action doesn't currently provide this information)
@bdehamer bdehamer added the feature-request New feature or request label Jun 19, 2024
@bdehamer
Copy link
Collaborator

@Pesa do you have a preference for how the attestation URL output should look? It would be pretty straightforward if there was only ever a single attestation generated. But with the possibility of multiple attestations, it's a bit more complex . . .

  • A comma-separate list of URLs: https://github.com/foo/bar/attestations/1317853,https://github.com/foo/bar/attestations/1317854
  • A comma-separated list of attestation IDs: 1317853,1317854
  • JSON: ['https://github.com/foo/bar/attestations/1317853','https://github.com/foo/bar/attestations/1317854']

Other ideas?

@Pesa
Copy link
Author

Pesa commented Jul 21, 2024

Ah, good question. I did not think of the case of multiple attestations. I don't have a strong preference, I've seen other actions use either JSON, comma-separated, or newline-separated lists. I suppose using JSON would be the most general, flexible, and future-proof approach (action consumers can use fromJSON to access individual IDs/URLs), though one could also say it's the most overkill.

An additional issue is that it's not obvious what artifact each attestation ID corresponds to. A possibly overkill solution would be to output a JSON object for each generated attestation, containing: subject-name, subject-digest, attestation-id, attestation-url.

@bdehamer
Copy link
Collaborator

There is some work to do still to figure out the best way to output the list of attestation links, but the 1.4.0 release does give you the option to suppress the summary output.

mustafacco7 added a commit to mustafacco7/attest-build-provenance that referenced this issue Oct 18, 2024
Fixes actions#126

Add option to suppress job summary and provide attestation URL output.

* Add `suppress-summary` input parameter to `action.yml` to control job summary suppression.
* Add `attestation-url` output parameter to `action.yml` to provide attestation URL.
* Import `getInput` and `setOutput` functions from `@actions/core` in `src/main.ts`.
* Check `suppress-summary` input value and conditionally skip summary generation in `src/main.ts`.
* Set `attestation-url` output with generated attestation URL in `src/main.ts`.
* Add `generateAttestationUrl` and `generateSummary` functions in `src/main.ts`.
* Update tests in `__tests__/main.test.ts` to cover `suppress-summary` input and verify `attestation-url` output.
* Add test for JSON output format for multiple attestations in `__tests__/main.test.ts`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/actions/attest-build-provenance/issues/126?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants