Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #75 from lonegunmanb/breaking-detect
Browse files Browse the repository at this point in the history
Add a CI step to detect potential breaking changes.
  • Loading branch information
lonegunmanb authored Oct 17, 2022
2 parents f494831 + e162ee6 commit 3261791
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 3261791

Please sign in to comment.