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

Add hint to needed permissions to write labels #184

Open
stevenengland opened this issue Feb 9, 2023 · 2 comments
Open

Add hint to needed permissions to write labels #184

stevenengland opened this issue Feb 9, 2023 · 2 comments

Comments

@stevenengland
Copy link

Hi, this is more a question/suggestion than an issue :)

In my newest repo the default permission for the GITHUB_TOKEN is restrictive (don't know if the default for that changed in the nearer past). That given it was not sufficient to use this token like in your README:

jobs:
  labeler:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Run Labeler
        if: success()
        uses: crazy-max/ghaction-github-labeler@v4
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }} # <--- This one

Instead I needed to add dedicated permissions to the job like so:

jobs:
  labeler:
    runs-on: ubuntu-latest
    permissions:
      issues: write # <--- permission granted explicitely
    steps:
     - name: Checkout
        uses: actions/checkout@v3
     
     - name: Run Labeler
        if: success()
        uses: crazy-max/ghaction-github-labeler@v4
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Can you confirm that? And might it be senseful to add a block into the readme section for that case?

KR

@crazy-max crazy-max changed the title [Q]: Add hint to needed permissions to write labels Add hint to needed permissions to write labels Sep 1, 2023
@ThomasKasene
Copy link

ThomasKasene commented Sep 6, 2023

I had what I believe is the same issue, although when I set permissions.issues: write, it was unable to check out the repository, så I needed this to make it work:

permissions:
  contents: read
  issues: write

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

No branches or pull requests

4 participants