Skip to content
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
10 changes: 10 additions & 0 deletions tests/files/test_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,13 @@ def test_whenProjectIsGenerated_expectReleaseCreatedOnVersionTags(
assert ' - "v*"\n' in content
assert "GH_TOKEN: ${{ github.token }}" in content
assert 'gh release create "$GITHUB_REF_NAME" dist/* ' in content


def test_whenProjectIsGenerated_expectReleaseFilesAttested(generate: Generate) -> None:
content = read_workflow(generate(), "release.yml")

assert " artifact-metadata: write\n" in content
assert " attestations: write\n" in content
assert " id-token: write\n" in content
assert " uses: actions/attest@" in content
assert " subject-path: dist/*\n" in content
8 changes: 8 additions & 0 deletions {{cookiecutter.artifact}}/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ jobs:
needs: [build, sbom]
runs-on: ubuntu-latest
permissions:
artifact-metadata: write
attestations: write
contents: write
id-token: write

steps:
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true

- name: Attest build provenance
uses: actions/attest@v4
with:
subject-path: dist/*

- name: Create release
env:
GH_TOKEN: {% raw %}${{ github.token }}{% endraw %}
Expand Down
Loading