mirror of
https://github.com/iptv-org/iptv
synced 2026-09-06 03:50:47 -04:00
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Validate Label
|
|
on:
|
|
issues:
|
|
types: [labeled]
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository code
|
|
uses: actions/checkout@v6
|
|
|
|
- uses: tibdex/github-app-token@v1.8.2
|
|
if: ${{ !env.ACT }}
|
|
id: create-app-token
|
|
with:
|
|
app_id: ${{ secrets.APP_ID }}
|
|
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
|
|
- name: Block self-approval
|
|
if: |
|
|
github.event.label.name == 'approved' &&
|
|
github.actor == github.event.issue.user.login
|
|
env:
|
|
GH_TOKEN: ${{ steps.create-app-token.outputs.token }}
|
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
run: |
|
|
if [ "${{ env.ACT }}" = "true" ]; then
|
|
echo "[MOCK] Post comment: A request cannot be approved by its author."
|
|
echo "[MOCK] Remove label: approved"
|
|
else
|
|
gh issue comment $ISSUE_NUMBER --body "A request cannot be approved by its author."
|
|
gh issue edit $ISSUE_NUMBER --remove-label "approved"
|
|
fi
|
|
|
|
exit 1
|