Skip to content

Commit

Permalink
Replaced close-pull-request with custom implementation allowing to ig…
Browse files Browse the repository at this point in the history
…nore dependabot PRs
  • Loading branch information
manami-project committed Feb 12, 2025
1 parent af7188c commit 2130a8c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/close-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ name: Close Pull Request

on:
pull_request_target:
types: [opened]
types: [opened, synchronize, reopened, edited]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "The content of this repo is completely generated. Therefore PRs are not accepted. You can check the [issue templates](https://github.com/manami-project/anime-offline-database/issues/new/choose) if you want to report something."
- name: Checkout repository
uses: actions/checkout@v4

- name: Close PR if it is not from Dependabot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then
echo "The content of this repo is completely generated. Therefore PRs are not accepted. You can check the [issue templates](https://github.com/manami-project/anime-offline-database/issues/new/choose) if you want to report something."
exit 0
fi
echo "Closing the PR as it's not from Dependabot."
gh pr close ${{ github.event.pull_request.number }} --comment "Automatically closing this PR" --delete-branch

0 comments on commit 2130a8c

Please sign in to comment.