Skip to content

Adjust staging drift workflow for squash-only PR policy #173

Adjust staging drift workflow for squash-only PR policy

Adjust staging drift workflow for squash-only PR policy #173

name: Require milestone on close
on:
issues:
types: [closed]
jobs:
enforce-milestone:
if: github.event.issue.state_reason == 'completed' && github.event.issue.milestone == null && !contains(github.event.issue.labels.*.name, 'no-milestone-close-ok')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Reopen issue and comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPO: ${{ github.repository }}
run: |
gh issue reopen "$ISSUE_NUMBER" --repo "$REPO"
gh issue comment "$ISSUE_NUMBER" --repo "$REPO" --body "⚠️ Issues closed as completed must have a milestone assigned. Please assign a milestone before closing, or add label \`no-milestone-close-ok\` for an approved exception."