What's the preferred way to access a private Swift Package (in the same org) from within a GitHub Action? The action doesn't have access to this repo/package and so the run fails with the following message:
xcodebuild: error: Could not resolve package dependencies: Authentication failed because no credentials were provided.
To access the packages from GitHub Packages, you should login to GitHub Packages at first.
When the packages are published on the same repository where the workflow is hosted, you can use the GITHUB_TOKEN to authenticate. If on different repository, you need to add a PAT with more scopes and set it as a secret in the workflow repository.
More details about GitHub Packages, you can reference here: https://help.github.com/en/github/managing-packages-with-github-packages
Thanks for your reply. We don't use GitHub Packages. It's just a simple repo containing a Swift Package (as in Swift Package Manager or SPM). And from what I see on the GitHub Packages website, this doesn't even support Swift Packages, does it?
Maybe you can try to checkout/clone the resource of your Swift Package from the repository when you want to use the package in the workflow on another repository.
And if the Swift Package is a dependence of the main project repository where the workflow is hosted, you also can consider to set the Swift Package repository as a submodule of the main project repository, and every time after you checkout the main project repository to the workspace, you can run the git commands to checkout the submodule to workspace.