Skip to content

Commit

Permalink
Add a CI step to detect potential breaking changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Oct 17, 2022
1 parent f494831 commit e162ee6
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 TFLINT_CONFIG=.tflint_alt.hcl -e SKIP_CHECKOV mcr.microsoft.com/azterraform:latest make pr-check
docker run --rm -v $(pwd):/src -w /src -e SKIP_CHECKOV -e TFLINT_CONFIG=.tflint_alt.hcl 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 e162ee6

Please sign in to comment.