Skip to content

Commit

Permalink
Merge pull request #268 from lonegunmanb/detect-breaking-ci
Browse files Browse the repository at this point in the history
Add breaking change detect CI step.
  • Loading branch information
lonegunmanb authored Oct 18, 2022
2 parents f37a9ad + be61ca0 commit 8fa1d74
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ on:
jobs:
prepr-check:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v3
- uses: jwalton/gh-find-current-pr@v1
id: PR
with:
state: open
- name: pr-check
run: |
docker run --rm -v $(pwd):/src -w /src -e SKIP_CHECKOV mcr.microsoft.com/azterraform:latest make pr-check
docker run --rm -v $(pwd):/src -w /src -e SKIP_CHECKOV mcr.microsoft.com/azterraform:latest make pr-check
- name: Breaking Change Brief
run: |
change=$(docker run --rm -t -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest breaking_detect /src ${{ github.repository_owner }} ${{ github.event.repository.name }} ${{ github.base_ref }})
if [ ! -z "$change" ]; then
msg=$(printf "Potential Breaking Changes in ${{ github.event.pull_request.head.sha }}:\n${change}")
jq -n --arg msg "$msg" '{body: $msg}' > body.txt
curl -s -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/${{ steps.PR.outputs.pr }}/comments -d @body.txt
fi

0 comments on commit 8fa1d74

Please sign in to comment.