Hello, @dgholz ! Welcome to the GitHub Community Forum––we’re glad to see you post this question here.
Permissions on “packages” is not currently available for all1 GitHub Apps (see GitHub Apps Permissions for more details).
We’re always working to improve GitHub and the GitHub Support Community, and we consider every suggestion we receive. Would you mind submitting this through our official product feedback form so that our product team can track your request?
It may be worth noting that you can use either of these tokens to authenticate with GitHub Packages:
-
a personal access token with the
read:packagesscope. - the
GITHUB_TOKENthat GitHub automatically creates for your repository when you enable GitHub Actions (seeAbout GitHub Packages with GitHub ActionsandPermissions for the GITHUB_TOKENfor more details).
We hope this helps!
1 At this time of writing, the GITHUB_TOKEN from GitHub Actions is an installation token associated with a GitHub App owned by GitHub and is the only GitHub App with access to packages.
As of December 2022 there is a solution.
In your organization, go to packages and select the packages you want access to. Under Package settings on the right you can add other repositories under "Manage Actions access". The other repositories only need read access.
In your YAML workflow file, add permissions for the workflow like so: Permissions example The workflow needs read access to contents and packages
Now you can use GITHUB_TOKEN to download packages in other private repositories
Workflow permissions: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
Repository access: https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#github-actions-access-for-organization-owned-container-images
You should be able to follow this post: https://www.schakko.de/2020/12/19/using-github-workflow-with-maven-dependencies-from-a-private-github-package-registry/
It is important to note that the GITHUB_TOKEN will only work for uploads and downloads within the same repository.
If you want to access a package from another repository, you have to create a personal access token and use username/token as authentication.
So basically your step 2. including your username should work.