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

[#1308][CI] label-pr workflow fails on fork-based PRs #1309

Merged
merged 1 commit into from
Feb 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@
name: "Pull Request Labeler"
run-name: Pull request labeler for ${{ github.ref_name }}

on:
pull_request:
types: [opened]
# NOTE: security risk from this action.
Copy link
Contributor

@bossenti bossenti Feb 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ for this proper documentation

# DO NOT add actions in here which need a checkout of the repo, and
# DO NOT use any caching in here.
on: pull_request_target

jobs:
label-pr:
if: >-
github.event.pull_request.user.login != 'octobot' &&
github.event.pull_request.user.login != 'dependabot[bot]'
permissions:
# for actions/labeler to determine modified files
contents: read
# for actions/labeler to add labels to PRs
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
configuration-path: .github/pr-labeler-config.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# Remove labels when matching files are reverted
sync-labels: true