Skip to content

Commit d91ef11

Browse files
committed
better error handling
1 parent fd3a791 commit d91ef11

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/branch_protection_settings/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"required_pull_request_reviews": {
1818
"url": "https://api.github.com/repos/aws-powertools/powertools-lambda-java/branches/main/protection/required_pull_request_reviews",
19-
"dismiss_stale_reviews": false,
19+
"dismiss_stale_reviews": true,
2020
"require_code_owner_reviews": false,
2121
"require_last_push_approval": false,
2222
"required_approving_review_count": 0

.github/workflows/security-branch-protections.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
GH_TOKEN: ${{ secrets.BRANCH_PROTECTION_TOKEN }}
3737
run: |
3838
# Fetch branch protections and store them in a file
39-
gh api /repos/${{ github.repository }}/branches/${{ matrix.branch }}/protection \
39+
gh api /repos/${{ github.repository }}/branches/${{ matrix.branch }}/protection | jq \
4040
> .github/branch_protection_settings/${{ matrix.branch }}.json
4141
- name: Compare branch protections
4242
id: compare
@@ -51,4 +51,5 @@ jobs:
5151
- name: Fail workflow
5252
if: ${{ env.diff_failed == 'true' }}
5353
run: |
54+
git diff .github/branch_protection_settings/${{ matrix.branch }}.json
5455
echo "::error::Branch protections have been changed"

0 commit comments

Comments
 (0)