Unverified Commit 8f6a1758 authored by Lianmin Zheng's avatar Lianmin Zheng Committed by GitHub
Browse files

Fix label pr for ci (#10441)

parent 01018138
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: ...@@ -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: |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment