Skip to content

Commit e819778

Browse files
committed
ci: update release workflows; add artifact attestation & SLSA
1 parent 503f424 commit e819778

4 files changed

Lines changed: 29 additions & 8 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [master]
66
paths:
77
- ".github/workflows/coverage.yml"
8+
- "api/*.py"
89
- "tests/*.py"
910
- "sonar-project.properties"
1011
pull_request:

.github/workflows/release.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
paths:
99
- ".github/workflows/release.yml"
1010
- "api/*.py"
11-
- "templates/*.j2"
1211
- "pyproject.toml"
1312
- "Dockerfile"
1413

@@ -29,6 +28,7 @@ jobs:
2928
permissions:
3029
id-token: write
3130
contents: write
31+
attestations: write
3232
environment:
3333
name: pypi
3434
url: https://pypi.org/project/Wakatime-Leaderboards/
@@ -89,6 +89,13 @@ jobs:
8989
pip install build==1.3.0
9090
python -m build
9191
92+
- name: Generate Artifact Attestation
93+
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
94+
with:
95+
subject-name: waka-leaderboards-python-dist
96+
subject-path: dist/*
97+
push-to-registry: true
98+
9299
- name: Publish to PyPI
93100
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
94101
with:
@@ -133,7 +140,7 @@ jobs:
133140
if: github.event_name != 'pull_request'
134141
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 # v3.10.0
135142
with:
136-
cosign-release: "v2.6.0"
143+
cosign-release: "v3.0.1"
137144

138145
- name: Setup Docker Buildx
139146
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
@@ -184,12 +191,20 @@ jobs:
184191
DIGEST: ${{ steps.push.outputs.digest }}
185192
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
186193

187-
- name: Generate Artifact Attestation
188-
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
194+
# - name: Generate Artifact Attestation
195+
# uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
196+
# with:
197+
# subject-name: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
198+
# subject-digest: ${{ steps.push.outputs.digest }}
199+
# push-to-registry: true
200+
201+
- name: Generate SLSA3 Provenance
202+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
189203
with:
190-
subject-name: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
191-
subject-digest: ${{ steps.push.outputs.digest }}
192-
push-to-registry: true
204+
image: ${{ needs.push.outputs.image }}
205+
digest: ${{ needs.push.outputs.digest }}
206+
registry-username: ${{ github.actor }}
207+
registry-password: ${{ secrets.GITHUB_TOKEN }}
193208

194209
- name: Docker Scout Scan
195210
uses: docker/scout-action@f8c776824083494ab0d56b8105ba2ca85c86e4de # v1.18.2

.github/workflows/wakatime.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ jobs:
2323
github.actor != 'protected-auto-commits[bot]'
2424
runs-on: ubuntu-latest
2525
steps:
26+
- name: Harden the runner
27+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
28+
with:
29+
egress-policy: audit
30+
2631
- name: GitHub App Token
27-
uses: actions/create-github-app-token@v2
32+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
2833
id: app-token
2934
with:
3035
app-id: ${{ secrets.GH_APP_ID }}

0 commit comments

Comments
 (0)