mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 22:27:22 +00:00
19 lines
640 B
YAML
19 lines
640 B
YAML
name: "Close Invalid PRs"
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- cloud
|
|
|
|
jobs:
|
|
close_pr:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Close invalid PRs
|
|
run: |
|
|
if [[ "${{ github.event.pull_request.head.ref }}" != "main" ]] && [[ "${{ github.event.pull_request.head.ref }}" != "dev-cloud" ]]; then
|
|
echo "This PR is from '${{ github.event.pull_request.head.ref }}', but only PRs from 'main' or 'dev-cloud' are allowed. Closing PR."
|
|
gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
|
|
fi
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|