Files
NewPipe/.github/workflows/template-label.yml
T
2026-10-15 00:59:20 +08:00

46 lines
1.3 KiB
YAML

# SPDX-FileCopyrightText: 2021-2022 NewPipe contributors <https://newpipe.net>
# SPDX-FileCopyrightText: 2026 NewPipe e.V. <https://newpipe-ev.de>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Template label comment
on:
issues:
types: [labeled]
pull_request:
types: [labeled]
permissions:
issues: write
pull-requests: write
jobs:
comment_on_label:
name: Comment on labeled issue/PR
if: ${{ github.event.label.name == 'template-ignored' || github.event.label.name == 'template-missing' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Get PR template
if: ${{ github.event.pull_request && github.event.label.name == 'template-missing' }}
run: |
set -euo pipefail
{
echo 'PR_TEMPLATE<<EOF'
curl https://raw.githubusercontent.com/TeamNewPipe/NewPipe/refs/heads/dev/.github/PULL_REQUEST_TEMPLATE.md
echo EOF
} >> $GITHUB_ENV
- name: Install js-yaml
run: npm install --no-save --ignore-scripts js-yaml@4.1.0
- name: Post comment
uses: actions/github-script@v8
timeout-minutes: 2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('.github/workflows/template-label.js');
await script({github, context});