1
0
Fork 0
toolkit/packages
Meriadec Pillet 717ba9d9a4
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
..
artifact Update artifact release notes 2024-10-08 14:06:04 -04:00
attest Handle tags containing "@" character in `buildSLSAProvenancePredicate` 2024-10-30 14:29:42 +01:00
cache Document unreleased changes in `cache` and `tool-cache` (#1856) 2024-10-22 12:01:31 -04:00
core Explicitly import `crypto` (#1842) 2024-10-04 17:23:42 -04:00
exec Update dependencies 2023-09-08 14:29:27 +00:00
github Add RUN_ATTEMPT to Github context 2023-11-28 16:32:10 +01:00
glob Add glob option to ignore hidden files (#1791) 2024-08-15 17:13:49 -04:00
http-client HTTP Client 2.2.3 Release (#1804) 2024-08-22 10:13:36 -04:00
io Update dependencies 2023-09-08 14:29:27 +00:00
tool-cache Document unreleased changes in `cache` and `tool-cache` (#1856) 2024-10-22 12:01:31 -04:00