mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-22 14:54:23 +00:00
Compare commits
1 Commits
runtime-rs
...
sprt/fix-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
100ecf3ee3 |
12
.github/workflows/validate-ok-to-test.yml
vendored
12
.github/workflows/validate-ok-to-test.yml
vendored
@@ -2,6 +2,7 @@ name: Validate ok-to-test label
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
# SAFETY: Jobs MUST NOT check out code.
|
||||
types: [synchronize]
|
||||
|
||||
jobs:
|
||||
@@ -15,16 +16,15 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||
OWNER: ${{ github.repository.owner.login }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||
FULL_REPO: ${{ github.event.repository.full_name }}
|
||||
run: |
|
||||
permission="$(gh api "repos/${OWNER}/${REPO}/collaborators/${AUTHOR}/permission" --jq '.permission')"
|
||||
echo "User ${AUTHOR} has permission '${permission}'"
|
||||
permission="$(gh api "repos/${FULL_REPO}/collaborators/${PR_AUTHOR}/permission" --jq '.permission')"
|
||||
echo "User ${PR_AUTHOR} has permission '${permission}'"
|
||||
|
||||
if [[ "${permission}" != "write" && "${permission}" != "admin" ]]; then
|
||||
echo "Removing 'ok-to-test' label"
|
||||
gh pr edit "${PR_NUMBER}" --repo "${OWNER}/${REPO}" --remove-label "ok-to-test"
|
||||
gh pr edit "${PR_NUMBER}" --repo "${FULL_REPO}" --remove-label "ok-to-test"
|
||||
else
|
||||
echo "User has label permission - skipping removal"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user