Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about personal access token #306

Open
morrowcj opened this issue Jan 25, 2023 · 6 comments
Open

Question about personal access token #306

morrowcj opened this issue Jan 25, 2023 · 6 comments

Comments

@morrowcj
Copy link

Problem

I'm trying to implement the add-to-project action to an organization's repository. It appears that, in order to do so, a personal access token is required:

# from action.yaml
github-token:
    required: true
    description: A GitHub personal access token with write access to the project

However, I don't fully understand how to store a PAT in an organization's secret variables. Does the "value" field of the secret variable actually need to be a PAT for this action to work? Since organizations aren't able to generate PATs, does one member of the org need to be responsible for generating and maintaining the token?

@omerbensaadon
Copy link
Contributor

Hey! Yes, one member needs to generate the token and add it as an organization Secret from the Repo settings page

@omerbensaadon
Copy link
Contributor

Check out these docs on encrypted secrets: https://docs.github.com/en/actions/security-guides/encrypted-secrets

@uhbif19
Copy link

uhbif19 commented Mar 15, 2023

Cannot GITHUB_TOKEN be used for that?

@saturnflyer
Copy link

I'm curious about @uhbif19's question too, @omerbensaadon
Is it required that it be a personal access token and not the GITHUB_TOKEN?

@levibostian
Copy link

This comment seems to suggest that, no, GITHUB_TOKEN cannot be used.

@saturnflyer
Copy link

saturnflyer commented Mar 30, 2023

Thanks for the update @levibostian

I'm trying this out on a private project with a bot account we use to share the PAT across our organization but the action just isn't running with that change. I'm fairly certain that I haven't set up permissions properly but debugging is difficult.
I'm poring over documentation about secrets/roles/permissions/etc but am commenting here hoping that someone has a straightforward explanation of how to set this up properly.

I'll comment again if I solve my problem.

EDIT: specifically I'm not seeing checks on my PRs but when I look at the Actions tab, I can see this action has failed but reports Could not resolve to a ProjectV2 with the number 9.
Is this a permissions problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants