ci: login to Forgejo registry with PAT, not GITHUB_TOKEN
Some checks failed
build-and-deploy / build-push-deploy (push) Failing after 9s
Some checks failed
build-and-deploy / build-push-deploy (push) Failing after 9s
Actions GITHUB_TOKEN reports Login Succeeded then 401s on POST /v2/.../blobs/uploads/. User PAT can write packages.
This commit is contained in:
parent
1e49062b78
commit
6e4209e745
1 changed files with 8 additions and 3 deletions
|
|
@ -56,9 +56,14 @@ jobs:
|
|||
- name: Login to Forgejo registry
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Forgejo Actions token can push packages when packages:write is granted
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login "${{ steps.img.outputs.reg }}" \
|
||||
-u "${{ github.actor }}" --password-stdin
|
||||
# GITHUB_TOKEN login "succeeds" but blob uploads 401 (Forgejo packages
|
||||
# reject the Actions token). Use a user PAT with write:package.
|
||||
if [ -z "${{ secrets.FORGEJO_TOKEN }}" ]; then
|
||||
echo "Missing repo secret FORGEJO_TOKEN (user PAT, not GITHUB_TOKEN)"
|
||||
exit 1
|
||||
fi
|
||||
echo "${{ secrets.FORGEJO_TOKEN }}" | docker login "${{ steps.img.outputs.reg }}" \
|
||||
-u sirius --password-stdin
|
||||
|
||||
- name: Build application image (api / ingester / cameras)
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue