Skip to content

Creating labels seems to require new permission #452

@UncleSamSwiss

Description

@UncleSamSwiss

Describe the bug

Running your action causes the following error:

Run # Label PR.
gh: You do not have permission to create labels on this repository. (HTTP 403)
Error: Process completed with exit code 1.

According to googleapis/release-please-action#1105 (comment) adding issues: write solves this.

permissions:
  actions: read        # Required to identify workflow run.
  checks: write        # Required to add status summary.
  contents: read       # Required to checkout repository.
  pull-requests: write # Required to add comment .
+ issues: write        # Required to add label.

To Reproduce

  1. Create a workflow with these permissions and this step:
jobs:
  deploy:
    permissions:
      actions: read
      checks: write
      contents: read
      pull-requests: write

    steps:
     ...
      - uses: op5dev/tf-via-pr@v13
        with:
          working-directory: terraform
          command: ${{ github.event_name == 'pull_request' && 'plan' || 'apply' }}
          validate: true
          arg-lock: ${{ github.event_name != 'pull_request' }}
  1. Run workflow
  2. Error happens

Expected behavior

Job shouldn't fail when creating the label.

Documentation and examples mention additional required permission.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions