Skip to content

github token not working #6

Closed

Description

@adelavega

Thank for this awesome example.

I've got this working on my project here: neuroscout/neuroscout-cli#136
I set it up to build based on Docker Hub builds using the same meta-data.

One thing I noticed is that for some reason, using {{ secrets.GITHUB_TOKEN }} did not work for me. Instead, I had to create a personal token from my account, and add it to the repository secrets.

If so, it may be worth updating the example.

Activity

  1. adelavega commented on Aug 16, 2021

    @adelavega
    ContributorAuthor

    Actually looks like the docs were say:

    To authenticate to the Container registry within a GitHub Actions workflow, use the GITHUB_TOKEN for the best security and experience. If your workflow is using a personal access token (PAT) to authenticate to ghcr.io, then we highly recommend you update your workflow to use the GITHUB_TOKEN.

    https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry

    And this guide says you must give permission to a specific repo's actions for a given package: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio

  2. vsoch commented on Aug 16, 2021

    @vsoch
    Member

    It should indeed work - I think there could be a few reasons it wouldn't:

    1. you didn't enable users to have public/private access to packages in the org settings
    2. your user doesn't have the correct permissions (everywhere I've used this successfully I have admin/owner)

    If you can give me a more specific error message I could perhaps help - I'm going for my run now but will be back in about an hour!

  3. adelavega commented on Aug 16, 2021

    @adelavega
    ContributorAuthor

    Sorry I updated my comments from under your feet but I think I found the problem.

    It's very unintuitive but even though a package is linked with a repo, that doesn't mean the repo's actions are automatically authorized to push to that package.

  4. adelavega commented on Aug 16, 2021

    @adelavega
    ContributorAuthor

    image

    I had to manually add the repo there.

  5. vsoch commented on Aug 16, 2021

    @vsoch
    Member

    Ah gotcha! Do you want to PR to update the docs here and clarify what you did so the next person doesn’t run into the same issue? It would be greatly appreciated.

  6. adelavega commented on Aug 16, 2021

    @adelavega
    ContributorAuthor

    Sure! I'll know shortly that this fixes my issue. I can also confirm I did the two things you mentioned above and that wasn't enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions