ci: grant contents:read so publish can checkout private repo
CI / lint (pull_request) Successful in 52s
CI / test (pull_request) Successful in 58s
CI / publish (pull_request) Has been skipped
CI / lint (push) Successful in 51s
CI / test (push) Successful in 56s
CI / publish (push) Failing after 29s

Setting `permissions: packages: write` alone dropped every other scope to
none, so actions/checkout could not clone the private repo and the publish
job failed before building. Add contents:read, and use github.actor (more
reliably populated than gitea.actor) as the twine username.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
LatteandClaude Opus 4.8 committed 2026-06-27 17:52:14 +02:00
1 parent 4223141cf7
commit a136853126
1 file changed
+2 -1
+2 -1
View File
@@ -42,6 +42,7 @@ jobs:
needs: [lint, test] needs: [lint, test]
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read # needed for checkout of the private repo
packages: write packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -70,7 +71,7 @@ jobs:
env: env:
# The auto-provided token works for the same owner's package registry. # The auto-provided token works for the same owner's package registry.
# Override with a PACKAGE_REGISTRY_TOKEN secret if your instance needs it. # Override with a PACKAGE_REGISTRY_TOKEN secret if your instance needs it.
TWINE_USERNAME: ${{ gitea.actor }} TWINE_USERNAME: ${{ github.actor }}
TWINE_PASSWORD: ${{ secrets.PACKAGE_REGISTRY_TOKEN || secrets.GITHUB_TOKEN }} TWINE_PASSWORD: ${{ secrets.PACKAGE_REGISTRY_TOKEN || secrets.GITHUB_TOKEN }}
run: | run: |
uvx twine upload \ uvx twine upload \