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

Closed
stevenengland opened this issue Feb 9, 2023 · 2 comments · Fixed by #219
Closed

Add hint to needed permissions to write labels #184

stevenengland opened this issue Feb 9, 2023 · 2 comments · Fixed by #219

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

@KyleKing
Copy link
Contributor

KyleKing commented Feb 21, 2023

@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

bruno-fs added a commit to bruno-fs/retrocookie-hypermodern-python that referenced this issue May 28, 2024
As per crazy-max/ghaction-github-labeler#184,
labeler requires permission to write to issues to work properly.
bruno-fs added a commit to bruno-fs/retrocookie-hypermodern-python that referenced this issue May 28, 2024
As per crazy-max/ghaction-github-labeler#184,
labeler requires permission to write to issues to work properly.
bruno-fs added a commit to bruno-fs/cookiecutter-hypermodern-python that referenced this issue May 28, 2024
As per crazy-max/ghaction-github-labeler#184,
labeler requires permission to write to issues to work properly.
bruno-fs added a commit to bruno-fs/cookiecutter-hypermodern-python that referenced this issue May 29, 2024
As per crazy-max/ghaction-github-labeler#184,
labeler requires permission to write to issues to work properly.
KyleKing added a commit to KyleKing/ghaction-github-labeler that referenced this issue Oct 27, 2024
crazy-max added a commit that referenced this issue Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants