27 Commits
Author SHA1 Message Date
Meredith Lancaster 1c1f3e0b2d fix linter issues
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-09 11:40:40 -08:00
Meredith Lancaster abeb7669df split mega param into several different ones
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-09 11:37:04 -08:00
Meredith Lancaster 6b1ea9ea05 linter fix
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-09 08:32:31 -08:00
Meredith Lancaster 290dbce022 fix expected endpoint response
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-09 08:02:38 -08:00
Meredith Lancaster 707729fc18 fix linter issues
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 16:22:59 -08:00
Meredith Lancaster 81160137d2 fix test and function calls
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 15:59:25 -08:00
Meredith Lancaster 3292a4a180 fix test calls
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 15:33:01 -08:00
Meredith Lancaster 94855dbe20 reorganize function options and document
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 15:25:34 -08:00
Meredith Lancaster 0056116f2b rename file
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 15:16:26 -08:00
Meredith Lancaster 23eec1d1a6 fix expected response
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 14:03:23 -08:00
Meredith Lancaster dd67f5558b fix function exporting and test results
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 13:49:54 -08:00
Meredith Lancaster 6e6225d5f6 use parameter objects and add tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-12-08 13:17:08 -08:00
Brian DeHamer 17259fc82d set workflow.ref provenance field from ref claim
Updates the `buildSLSAProvenancePredicate` function to populate the
`workflow.ref` field from the `ref` claim in the OIDC token.

Signed-off-by: Brian DeHamer <bdehamer@github.com>
2025-02-26 08:47:27 -08:00
Brian DeHamer 51b0cb5578 Merge pull request #1863 from meriadec/attest-provenance-tags
Handle tags containing "@" character in `buildSLSAProvenancePredicate`
2024-11-01 09:35:13 -07:00
Brian DeHamer 65ddc04895 support multi-subject attestations
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-11-01 09:08:19 -07:00
Meriadec Pillet 14010a8882 Handle tags containing "@" character in buildSLSAProvenancePredicate
When using some monorepo-related tools (like [changesets](https://github.com/changesets/changesets)),
the produced tags have a special format that includes `@` character.

For example, a `foo` package on a monorepo will produce Git tags looking
like `foo@1.0.0` if using changesets.

When used in combination with `actions/attest-build-provenance`, the
action was not properly re-crafting the tag in `buildSLSAProvenancePredicate` because
it was always splitting the workflow ref by `@` and taking the second
element.

This result in this error on CI:

```
Error: Error: Failed to persist attestation: Invalid Argument - values do not match: refs/tags/foo != refs/tags/foo@1.0.0 - https://docs.github.com/rest/repos/repos#create-an-attestation
````

This PR slightly update the logic there, and rather take "everything
located after the first '@'". This shouldn't introduce any breaking
change, while giving support for custom tags.

I've added the corresponding test case, it passes, however I couldn't
successfully run the full test suite (neither on `main`). Looking
forward for CI outcome.

Thanks in advance for the review 🙏.
2024-10-30 14:29:42 +01:00
Brian DeHamer 19beeb5851 fix bug with customized oidc issuer
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-09-04 10:24:28 -07:00
Brian DeHamer cda5d64e13 derive default OIDC issuer from current tenant
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-08-16 12:07:23 -07:00
Brian DeHamer 29f863eb6f support for headers param in attest functions
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-08-15 15:35:32 -07:00
Brian DeHamer ccea2d41a8 fix proxy support for jwks retrieval
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-07-26 15:03:40 -07:00
Brian DeHamer a035e0d5d5 new GHA build provenance
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-06-05 14:54:34 -07:00
Fredrik Skogman 5f94fee887 Read the server url from the environment variable.
Instead of having the urls hardcoded, read them from the environment.
I opted to read from the environment variable instead of the github context
because it would be easier to test.
2024-05-16 17:00:35 +02:00
Brian DeHamer 019fe54f20 retry request on failure to save attestation
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-04-24 15:07:39 -07:00
Brian DeHamer f04c795925 remove dep on make-fetch-happen
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-04-23 09:39:17 -07:00
Brian DeHamer 04a08a9a42 generate v0.3 bundles in attest package
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-04-03 12:12:26 -07:00
Brian DeHamer 4de6ecc2c7 build provenance stmt from OIDC claims
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-03-22 12:34:42 -07:00
Brian DeHamer ab53ed1045 add new @actions/attest package
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-02-26 08:52:20 -08:00