Skip to content

Commit c6cf246

Browse files
authored
Merge pull request #8 from aboutcode-org/fix-release-workflow
Add proper permissions for release workflow
2 parents 4704b6c + e89cfd9 commit c6cf246

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

‎.github/workflows/publish-docker-image.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
with:
4444
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4545
tags: |
46-
type=sha,event=workflow_dispatch,enable=${{ !startsWith(github.ref, 'refs/tags/') }}
4746
type=semver,pattern={{version}}
4847
labels: |
4948
org.opencontainers.image.title=HealthyCode
@@ -67,10 +66,11 @@ jobs:
6766
${{ steps.meta.outputs.tags }}
6867
labels: ${{ steps.meta.outputs.labels }}
6968
annotations: ${{ steps.meta.outputs.annotations }}
69+
provenance: false
7070

7171
- name: Generate artifact attestation for Docker image
7272
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
7373
with:
7474
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7575
subject-digest: ${{ steps.push.outputs.digest }}
76-
push-to-registry: true
76+
push-to-registry: true

‎.github/workflows/pypi-release.yml‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@ jobs:
4949
path: dist/*
5050

5151

52-
create-gh-release:
53-
name: Create GH release
52+
create-pypi-release:
53+
name: Create PyPI release
5454
needs:
55-
- build-pypi-distribs
55+
- create-gh-release
5656
runs-on: ubuntu-24.04
57+
environment: pypi-publish
58+
permissions:
59+
id-token: write
5760

5861
steps:
5962
- name: Download built archives
@@ -62,21 +65,18 @@ jobs:
6265
name: pypi_archives
6366
path: dist
6467

65-
- name: Create GH release
66-
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
67-
with:
68-
draft: true
69-
files: dist/*
68+
- name: Publish to PyPI
69+
if: startsWith(github.ref, 'refs/tags')
70+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
7071

7172

72-
create-pypi-release:
73-
name: Create PyPI release
73+
create-gh-release:
74+
name: Create GH release
7475
needs:
75-
- create-gh-release
76+
- build-pypi-distribs
7677
runs-on: ubuntu-24.04
77-
environment: pypi-publish
7878
permissions:
79-
id-token: write
79+
contents: write
8080

8181
steps:
8282
- name: Download built archives
@@ -85,6 +85,8 @@ jobs:
8585
name: pypi_archives
8686
path: dist
8787

88-
- name: Publish to PyPI
89-
if: startsWith(github.ref, 'refs/tags')
90-
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
88+
- name: Create GH release
89+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
90+
with:
91+
draft: true
92+
files: dist/*

0 commit comments

Comments
 (0)