I have a workflow that uses an action from a public repository I control. The action in turn uses its own docker image from docker.pkg.github.com. The following does not work, because it gives a -no basic auth credentials- error:
build-linux:
runs-on: ubuntu-latest
name: Linux
steps:
- name: Build
uses: sot/skare3/actions/build@gh-actions
I have thought of doing something like this as work around:
jobs:
build-linux:
runs-on: ubuntu-latest
name: Linux
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Package Registry
run: echo "${{ secrets.GITHUB_PKG_TOKEN }}" | docker login docker.pkg.github.com -u <user> --password-stdin
- name: Build
id: build
uses: ./actions/build
with a dummy action that contains a Dockerfile like this:
FROM docker.pkg.github.com/sot/skare3/centos5-conda:1.0
Is that the best I can do? Is there no way to authenticate with docker.pkg.github.com before the action gets built? or during the action building process? I would not want to create this dummy action in every single project that uses the original action.
EDIT: after posting, I found this related postĀ https://github.community/t5/GitHub-Actions/Use-docker-images-from-GitHub-Package-Registry/td-p/30407