mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
Workflow to check that a PR has a milestone set
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
name: "Check PR Has Milestone"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ opened, edited, synchronize, reopened ]
|
||||
branches:
|
||||
- dev
|
||||
- master
|
||||
- V6
|
||||
|
||||
concurrency:
|
||||
group: "check-pr-milestone-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fail-on-bad-milestone:
|
||||
name: Fail if Pull Request has no Associated Version Milestone
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fail if no Milestone Set
|
||||
if: github.event.pull_request.milestone == null
|
||||
run: |
|
||||
echo "::error::Pull request must have milestone set!"
|
||||
exit 1
|
||||
|
||||
- name: Fail if Invalid Milestone Set
|
||||
run: |
|
||||
if [[ ${{ github.event.pull_request.milestone }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
exit 0
|
||||
fi
|
||||
echo "::error::Pull request has non-standard milestone!"
|
||||
exit 1
|
||||
Reference in New Issue
Block a user