mirror of
https://github.com/penpot/penpot.git
synced 2026-11-18 16:12:24 +00:00
🔧 Require milestone in PRs (#13129)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
This commit is contained in:
parent
d563444985
commit
89d5a862b5
@ -37,6 +37,7 @@ jobs:
|
||||
OWNER="${REPOSITORY%%/*}"
|
||||
REPO="${REPOSITORY#*/}"
|
||||
|
||||
# shellcheck disable=SC2016 # GraphQL variables, not shell expansion.
|
||||
ISSUES=$(gh api graphql \
|
||||
-F owner="$OWNER" \
|
||||
-F repo="$REPO" \
|
||||
|
||||
45
.github/workflows/require-milestone.yml
vendored
Normal file
45
.github/workflows/require-milestone.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: Require Milestone
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
- edited
|
||||
- milestoned
|
||||
- demilestoned
|
||||
- ready_for_review
|
||||
- converted_to_draft
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
check-milestone:
|
||||
name: Require Milestone
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check milestone
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
pr_api="repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}"
|
||||
|
||||
is_draft=$(gh api "$pr_api" --jq '.draft')
|
||||
milestone=$(gh api "$pr_api" --jq '.milestone.title // ""')
|
||||
|
||||
if [ "$is_draft" = "true" ]; then
|
||||
echo "Draft PR: milestone check skipped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$milestone" ]; then
|
||||
echo "::error::This pull request must have a milestone."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Milestone assigned: $milestone"
|
||||
Loading…
x
Reference in New Issue
Block a user