Skip to content

Commit

Permalink
[repo] Auto label PR workflow permissions fix (#5684)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Jun 11, 2024
1 parent 23fb651 commit 48ce500
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
issues:
types: [ opened ]

pull_request:
pull_request_target:
branches: [ 'main*' ]

permissions:
Expand Down Expand Up @@ -33,13 +33,15 @@ jobs:
ISSUE_BODY: ${{ github.event.issue.body }}

add-labels-on-pull-requests:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request_target'

runs-on: ubuntu-latest

steps:
- name: check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }} # Note: Do not run on the PR branch we want to execute add-labels.psm1 from main on the base repo only because pull_request_target can see secrets

- name: Add labels for files changed on pull requests
shell: pwsh
Expand Down

0 comments on commit 48ce500

Please sign in to comment.