Skip to content

Commit

Permalink
Adds a GHA check for breaking change description (#3074)
Browse files Browse the repository at this point in the history
* Adds a GHA check for breaking change description

* prettier
  • Loading branch information
crystalin authored Dec 5, 2024
1 parent 1ec16d3 commit 67113c7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,26 @@ jobs:
REQUIRED_LABELS_ANY: "D1-audited👍,D5-nicetohaveaudit⚠️,D9-needsaudit👮,D2-notlive,D3-trivial"
REQUIRED_LABELS_ALL: ""
BANNED_LABELS: ""
validate-breaking-description:
runs-on: ubuntu-latest
steps:
- name: Validate PR for "breaking" label and description
env:
PR_BODY: ${{ github.event.pull_request.body }}
PR_LABELS: ${{ toJson(github.event.pull_request.labels) }}
run: |
echo "Pull Request Labels: $PR_LABELS"
echo "Pull Request Body: $PR_BODY"
# Check if "breaking" label is set
if echo "$PR_LABELS" | grep -q '"breaking"'; then
echo "Label 'breaking' is present. Checking description..."
if echo "$PR_BODY" | grep -qi "## ⚠️ Breaking Changes ⚠️"; then
echo "✅ Description contains the required phrase."
else
echo "❌ Description does not contain the required phrase '## ⚠️ Breaking Changes ⚠️'."
exit 1
fi
else
echo "Label 'breaking' is not present. No validation needed."
fi

0 comments on commit 67113c7

Please sign in to comment.