From 094ee671d7eecabba86c56efb6f66493de4abfb9 Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 18:41:17 +0000 Subject: [PATCH] os.yml: Publish with the PACKAGE_TOKEN secret Gitea gives the job token at most read access to a user's packages, so publishing needs a token of the owner. The permissions block didn't help and goes; the default lets actions/checkout read the repository. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 07abc59..6261105 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -8,6 +8,8 @@ # - SIGNING_KEY repository secret: the armored private gpg key whose # public half is mkosi.extra/usr/lib/systemd/ # import-pubring.pgp, which systemd-sysupdate checks. +# - PACKAGE_TOKEN repository secret: a token of the package owner with only +# write:package. The job token can't write packages. name: os on: push: @@ -19,9 +21,6 @@ on: jobs: os: runs-on: linux - permissions: - contents: read - packages: write steps: - name: Install tools run: dnf install -yq mkosi @@ -55,7 +54,7 @@ jobs: working-directory: mkosi.output env: PKG: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/runneros/latest - AUTH: "Authorization: token ${{ gitea.token }}" + AUTH: "Authorization: token ${{ secrets.PACKAGE_TOKEN }}" run: | curl -fsS -H "$AUTH" -X DELETE "$PKG" || true for f in runneros_*.efi runneros_*.usr-*.raw.zst runneros.qcow2 runneros_*.manifest SHA256SUMS.gpg SHA256SUMS; do