pozil / auto-assign-issue

GitHub Action that auto-assigns issues or PRs to one or more users
Creative Commons Zero v1.0 Universal
52 stars 27 forks source link

Issue with repo-token #127

Open ItsGiantCookie opened 6 days ago

ItsGiantCookie commented 6 days ago

Hi, I'm new to using Personal Access Tokens and Secrets and I'm having some issues with using my Personal Access Token in my Org. It is a fine-grained token, it's set as active in the Org itself and has the permission 'members' with read permission, which according to the short text, should give access to the Orgs teams and members info.

image

Is there a specific way to put a PAT into a Org-Secret to make it work?

This is the code I used.

name: PR and Issue assignment

on:
    issues:
      types: [opened]

    pull_request:
        types: [opened, edited, synchronize, reopened]

jobs:
    auto-assign:
        runs-on: ubuntu-latest
        permissions:
            issues: write
            pull-requests: write
        steps:
            - name: 'Auto-assign PR and Issues'
              uses: pozil/auto-assign-issue@v2
              with:
                  repo-token: ${{ secrets.GR_MM_TOKEN_LOCAL }}
                  teams: scripting
                  numOfAssignee: 1
pozil commented 3 days ago

Hi @ItsGiantCookie, this should just be a matter of copy pasting the PAT value as a new org secret and providing access to your repo.

Screenshot 2024-07-01 at 15 43 07

One thing that could explain your issue is if your workflow is triggered by a fork from a repo that is not part of your org (a third party contribution). As per GitHub security rules, third party forks don't have access to the repo/org secrets so this could explain why the value of the secret is blank.