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

View File

@@ -5,22 +5,20 @@ 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. # In the run name, ${{ github.actor }} shows who's privileges are used for this run.
# #
on: on: pull_request_target
pull_request:
types: [opened, reopened, synchronize, labeled]
jobs: jobs:
Check: Check:
permissions: permissions:
pull-requests: read pull-requests: read
name: Check label and authorization name: Check label and authorization
if: contains(github.event.pull_request.labels.*.name, 'Build')
runs-on: Linux runs-on: Linux
outputs: outputs:
member: ${{ steps.checkUserMember.outputs.isTeamMember }} member: ${{ steps.checkUserMember.outputs.isTeamMember }}
steps: steps:
- uses: tspascoal/get-user-teams-membership@v3 - uses: tspascoal/get-user-teams-membership@v3
if: contains(github.event.pull_request.labels.*.name, 'Build')
id: checkUserMember id: checkUserMember
with: with:
username: ${{ github.actor }} username: ${{ github.actor }}

View File

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