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

Update documentation to define permissions required by action #7

Open
iacabezasbaculima opened this issue Jun 24, 2023 · 0 comments · May be fixed by #8
Open

Update documentation to define permissions required by action #7

iacabezasbaculima opened this issue Jun 24, 2023 · 0 comments · May be fixed by #8

Comments

@iacabezasbaculima
Copy link

The following permissions must be added to a GitHub Actions workflow:

permissions:
  pull-requests: write
  issues: write

This will provide the default GITHUB_TOKEN permissions to work with issues and pull requests.

Currently, the GitHub REST API endpoint used to add a label is shared by issues and pull requests.

Therefore, the documentation on how to use the action should be updated as follows:

name: 🏷 PR size labeler

on: [pull_request]

permissions:
  pull-requests: write
  issues: write

jobs:
  pr-labeler:
    runs-on: ubuntu-latest
    name: Label the PR size
    steps:
      - uses: BedrockStreaming/pr-size-labeler@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          exclude_files: .lock

References:
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

Rindula added a commit to Rindula/pr-size-labeler that referenced this issue Jun 25, 2023
@Rindula Rindula linked a pull request Jun 25, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant