Fix label pr for ci (#10441)
This commit is contained in:
20
.github/workflows/label-pr.yml
vendored
20
.github/workflows/label-pr.yml
vendored
@@ -1,6 +1,5 @@
|
|||||||
name: Label PRs for CI
|
name: Label PR for CI
|
||||||
|
|
||||||
# This workflow runs on pull requests that are opened or reopened.
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, reopened]
|
types: [opened, reopened]
|
||||||
@@ -13,12 +12,17 @@ jobs:
|
|||||||
labeler:
|
labeler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Add 'run-ci' label for authors with write access
|
- name: Check user permission
|
||||||
# This 'if' condition checks the PR author's association with the repository.
|
id: checkAccess
|
||||||
# It proceeds only if the author is an OWNER, MEMBER, or COLLABORATOR.
|
uses: actions-cool/check-user-permission@v2
|
||||||
if: >
|
with:
|
||||||
contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'),
|
require: write
|
||||||
github.event.pull_request.author_association)
|
username: ${{ github.triggering_actor }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Add run-ci label
|
||||||
|
if: steps.checkAccess.outputs.require-result == 'true'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
|||||||
Reference in New Issue
Block a user