Files
iptv/.github/workflows/validate_issue.yml
T
dependabot[bot] b2f8c36b20 ci: bump actions/checkout from 6.1.0 to 7.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.1.0 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/d23441a48e516b6c34aea4fa41551a30e30af803...3d3c42e5aac5ba805825da76410c181273ba90b1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-14 12:24:50 +00:00

76 lines
2.5 KiB
YAML

name: Validate Issue
on:
issues:
types: [opened, edited]
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
if: |
contains(github.event.issue.labels.*.name, 'streams:add') ||
contains(github.event.issue.labels.*.name, 'streams:remove') ||
contains(github.event.issue.labels.*.name, 'streams:edit')
steps:
- name: Checkout repository code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: tibdex/github-app-token@0d49dd721133f900ebd5e0dff2810704e8defbc6 # v1.8.2
if: ${{ !env.ACT }}
id: create-app-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run issue:validate
id: validator
env:
RAW_BODY: ${{ github.event.issue.body }}
LABEL_STRING: ${{ join(github.event.issue.labels.*.name, ',') }}
run: |
npm run issue:validate -- \
--body "$RAW_BODY" \
--labels "$LABEL_STRING"
- name: Handle valid request
if: success()
env:
GH_TOKEN: ${{ steps.create-app-token.outputs.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
if [ "${{ env.ACT }}" = "true" ]; then
echo "[MOCK] Add label: check:passed"
echo "[MOCK] Remove label if exists: check:failed"
else
gh issue edit $ISSUE_NUMBER --add-label "check:passed" --remove-label "check:failed"
fi
- name: Handle invalid request
if: failure() && steps.validator.outcome == 'failure'
env:
GH_TOKEN: ${{ steps.create-app-token.outputs.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
COMMENT_MSG=$(cat temp/logs/errors.txt)
if [ "${{ env.ACT }}" = "true" ]; then
echo "[MOCK] Post comment:"
echo "$COMMENT_MSG"
echo "[MOCK] Add label: check:failed"
echo "[MOCK] Remove label if exists: check:passed"
else
gh issue comment $ISSUE_NUMBER --body "$COMMENT_MSG"
gh issue edit $ISSUE_NUMBER --add-label "check:failed" --remove-label "check:passed"
fi