Skip to content

Commit 69bc8a7

Browse files
author
Philip Sampaio
authored
Use GitHub Actions' "artifact attestation" feature (#13653)
The idea is to have a way to ensure that the artifacts were not tempered after the build. You can find details in the projects page: https://github.com/actions/attest-build-provenance There is also the docs page: https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
1 parent 252d4fa commit 69bc8a7

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/workflows/builds.hex.pm.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ concurrency: builds_txt
1717

1818
jobs:
1919
release_pre_built:
20+
permissions:
21+
id-token: write
22+
attestations: write
2023
strategy:
2124
fail-fast: true
2225
max-parallel: 1
@@ -42,6 +45,13 @@ jobs:
4245
otp_version: ${{ matrix.otp_version }}
4346
otp: ${{ matrix.otp }}
4447
build_docs: ${{ matrix.build_docs }}
48+
- uses: actions/attest-build-provenance@v1
49+
with:
50+
subject-path: 'elixir-otp-${{ matrix.otp }}.*'
51+
- uses: actions/attest-build-provenance@v1
52+
if: ${{ matrix.build_docs }}
53+
with:
54+
subject-path: 'Docs.*'
4555
- name: Utils.sh
4656
run: |
4757
cat << 'EOF' > utils.sh

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ env:
1212

1313
permissions:
1414
contents: write
15+
id-token: write
16+
attestations: write
1517

1618
jobs:
1719
create_draft_release:
@@ -50,6 +52,17 @@ jobs:
5052
otp_version: ${{ matrix.otp_version }}
5153
otp: ${{ matrix.otp }}
5254
build_docs: ${{ matrix.build_docs }}
55+
- uses: actions/attest-build-provenance@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
subject-path: 'elixir-otp-${{ matrix.otp }}.*'
60+
- uses: actions/attest-build-provenance@v1
61+
if: ${{ matrix.build_docs }}
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
with:
65+
subject-path: 'Docs.*'
5366
- name: Upload Pre-built
5467
env:
5568
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release_pre_built/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ runs:
4646
ref=v$(curl -s https://hex.pm/api/packages/ex_doc | jq --raw-output '.latest_stable_version')
4747
fi
4848
echo "EX_DOC_REF=$ref" >> $GITHUB_ENV
49-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5050
if: ${{ inputs.build_docs }}
5151
with:
5252
repository: elixir-lang/ex_doc

0 commit comments

Comments
 (0)