forgejo-guardian/.github/workflows/auto_close_pr.yml
Awiteb 8a80e58e54
All checks were successful
Write changelog / write-changelog (push) Successful in 4s
Rust CI / Rust CI (push) Successful in 7m0s
CD / build-assets (aarch64-unknown-linux-gnu) (push) Successful in 7m7s
CD / build-assets (aarch64-unknown-linux-musl) (push) Successful in 7m8s
CD / build-assets (x86_64-unknown-linux-gnu) (push) Successful in 4m11s
CD / build-assets (x86_64-unknown-linux-musl) (push) Successful in 4m14s
CD / release (push) Successful in 12s
chore: Add CI/CD
Signed-off-by: Awiteb <a@4rs.nl>
2024-11-16 13:12:59 +00:00

34 lines
1.1 KiB
YAML

name: Auto close PR
on:
pull_request:
types: [opened, reopened]
jobs:
close_pr:
name: Auto close PR
runs-on: ubuntu-latest
steps:
- name: Send close comment
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments \
-d '{"body":"${{ env.BODY }}"}'
env:
PAT: ${{ secrets.PAT }}
BODY: This repository is mirror only and you cannot create a pull request for it. Please open your PR in https://git.4rs.nl/awiteb/forgejo-guardian
- name: Close the PR
run: |
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }} \
-d '{"state":"closed"}'
env:
PAT: ${{ secrets.PAT }}