Skip to content

Commit

Permalink
Fix BREAKING_CHANGE string detection in commit msg / PR body
Browse files Browse the repository at this point in the history
BREAKING_CHANGE
  • Loading branch information
hubcio committed Mar 2, 2024
1 parent 90e6034 commit 8b30b18
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/backwards_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Print the event payload
run: cat "$GITHUB_EVENT_PATH"

- name: Check for BREAKING_CHANGE in commit message
id: check_commit
run: |
COMMIT_MSG=$(git log --format=%B -n 1 HEAD)
echo "Commit message: $COMMIT_MSG"
if echo "$COMMIT_MSG" | grep -q "BREAKING_CHANGE"; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "skip=true, 'BREAKING_CHANGE' found in commit message"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "skip=false, 'BREAKING_CHANGE' not found in commit message"
fi
- name: Check for BREAKING_CHANGE in pull request body
Expand All @@ -34,8 +39,10 @@ jobs:
echo "Pull Request body: $PR_MSG_BODY"
if [[ "$PR_MSG_BODY" == *"BREAKING_CHANGE"* ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "skip=true, 'BREAKING_CHANGE' found in pull request body"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "skip=false, 'BREAKING_CHANGE' not found in pull request body"
fi
build_and_test:
Expand All @@ -44,6 +51,8 @@ jobs:
if: ${{ needs.check_commit_message.outputs.should_skip != 'true' }}
steps:
- run: echo "${{ needs.check_commit_message.outputs.should_skip }}"
- run: echo "${{ needs.check_commit_message.outputs.should_skip }}"
- run: echo "${{ needs.check_commit_message.outputs.should_skip }}"

- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 8b30b18

Please sign in to comment.