From b30315ad47c5a1787ade2c72af05ceee030526de Mon Sep 17 00:00:00 2001 From: Vladislav Doster Date: Fri, 29 Apr 2022 01:52:54 -0500 Subject: [PATCH] fix: permissions for PR labeler GH action workflow Signed-off-by: Vladislav Doster --- .github/labeler.yml | 27 ++++++++----------- .../workflows/{labeler.yml => labeler.yaml} | 11 +++++--- 2 files changed, 18 insertions(+), 20 deletions(-) rename .github/workflows/{labeler.yml => labeler.yaml} (73%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 6ba78e5a8..3f36cc36a 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,16 +1,11 @@ -# Add 'zinit` label to any change in a zinit file -zinit: -- zinit*.zsh -# Add 'scripts` label to any change in scripts/ directory -scripts: -- scripts/* -# Add 'docs` label to any change in doc/ directory -docs: -- docs/* -- doc/**/* -# Add 'tests` label to any change in tests/ directory -tests: -- tests/* -ci/cd: -- .github/* -- .github/**/* +ci/cd: ['.github/**/*'] + +docs: ['docker/*'] + +docs: ['doc/**/*'] + +scripts: ['scripts/*'] + +tests: ['tests/**/*', '.zunit.yml'] + +zinit: ['zinit*.zsh', '_zinit'] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yaml similarity index 73% rename from .github/workflows/labeler.yml rename to .github/workflows/labeler.yaml index 8d689adad..a5484b10d 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yaml @@ -1,18 +1,21 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. +# This workflow will triage pull requests and apply a label based on the paths +# that are modified in the pull request. name: Labeler -on: [pull_request] + +on: [pull_request_target] jobs: label-pull-requests: - runs-on: ubuntu-latest permissions: contents: read pull-requests: write + runs-on: ubuntu-latest + steps: - uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" + sync-labels: true