Change pull request trigger in order to get permissions back in order

This commit is contained in:
Igor Pecovnik
2024-10-31 08:39:50 +01:00
committed by Igor
parent 8b3fb65404
commit d355c17dc3
3 changed files with 9 additions and 9 deletions

View File

@@ -4,9 +4,7 @@ run-name: 'Set labels - PR #${{ github.event.pull_request.number }} ("${{ github
# Set labels for pull requests automatically based on size (modified via job 'label-size') and file categories (modified via .github/labeler)
#
on:
pull_request:
types: [opened, reopened, synchronize]
on: pull_request_target
jobs:
label-remove:
@@ -17,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: PauMAVA/add-remove-label-action@v1.0.3
if: ${{ github.event.action == opened || github.event.action == reopened || github.event.action == synchronize }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add: ""
@@ -33,6 +32,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/labeler@v5
if: ${{ github.event.action == opened || github.event.action == reopened || github.event.action == synchronize }}
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -47,6 +47,7 @@ jobs:
steps:
- name: size-label
uses: "pascalgn/size-label-action@v0.5.5"
if: ${{ github.event.action == opened || github.event.action == reopened || github.event.action == synchronize }}
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:

View File

@@ -5,9 +5,7 @@ run-name: "Generate artifacts - PR #${{ github.event.pull_request.number }} - by
# In the run name, ${{ github.actor }} shows who's privileges are used for this run.
#
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
on: pull_request_target
jobs:
Check:
@@ -15,12 +13,12 @@ jobs:
pull-requests: read
name: Check label and authorization
if: contains(github.event.pull_request.labels.*.name, 'Build')
runs-on: Linux
outputs:
member: ${{ steps.checkUserMember.outputs.isTeamMember }}
steps:
- uses: tspascoal/get-user-teams-membership@v3
if: contains(github.event.pull_request.labels.*.name, 'Build')
id: checkUserMember
with:
username: ${{ github.actor }}

View File

@@ -1,7 +1,8 @@
on: pull_request_review
on: pull_request_target
name: Label approved pull requests
jobs:
labelWhenApproved:
if: github.event.review.state == 'approved'
name: Label when approved
runs-on: ubuntu-latest
steps: