Updated the Solus workflow to grant packages: read (alongside contents: read) at workflow scope, so the Actions token can authenticate for GHCR package pulls.

Added a conditional GHCR login step (docker/login-action@v3) that runs when the selected image is under ghcr.io/*, using ${{ github.actor }} and ${{ github.token }} before docker pull.

Left the existing build/pull flow intact after authentication, so behavior is unchanged except for fixing anonymous-pull denial cases.
This commit is contained in:
2026-02-18 10:44:45 -07:00
parent 10f6b4913e
commit e8f4044f8c

View File

@@ -16,6 +16,10 @@ on:
- main - main
- master - master
permissions:
contents: read
packages: read
jobs: jobs:
build-eopkg: build-eopkg:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -26,6 +30,14 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Log in to GHCR (for ghcr.io images)
if: startsWith(env.SOLUS_IMAGE, 'ghcr.io/')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build eopkg package in Solus container - name: Build eopkg package in Solus container
run: | run: |
if [ ! -f "$PACKAGE_YML" ]; then if [ ! -f "$PACKAGE_YML" ]; then