fix(deps): update python #1645
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OpenAPI Diff | |
on: [pull_request] | |
jobs: | |
openapi-diff: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: ${{ github.head_ref }} | |
path: head | |
- name: Checkout BASE | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: ${{ github.base_ref }} | |
path: base | |
- name: Generate oasdiff changelog | |
id: oasdif_changelog | |
run: | # Capture changelog as a multiline output | |
echo "changelog<<EOF" > $GITHUB_OUTPUT | |
docker run --rm \ | |
--workdir ${{ github.workspace }} \ | |
--volume ${{ github.workspace }}:${{ github.workspace }}:rw \ | |
-e GITHUB_WORKSPACE=${{ github.workspace }} \ | |
tufin/oasdiff changelog --composed \ | |
'base/openapi/specs/*.yaml' \ | |
'head/openapi/specs/*.yaml' \ | |
>> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Get summary | |
id: oasdif_summary | |
run: | | |
echo summary=$(echo "${{ steps.oasdif_changelog.outputs.changelog }}" | head -1 ) \ | |
>> $GITHUB_OUTPUT | |
- name: Find existing comment | |
id: find_comment | |
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body-includes: "## OpenAPI Changes" | |
- name: Post changes as comment | |
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3 | |
# Even if no changes, make sure to update old comment if it was found. | |
if: steps.oasdif_summary.outputs.summary || steps.find_comment.outputs.comment-id | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
edit-mode: "replace" | |
repository: ${{ github.repository }} | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-id: ${{ steps.find_comment.outputs.comment-id }} | |
body: | | |
## OpenAPI Changes | |
<details> | |
<summary>Show/hide ${{ steps.oasdif_summary.outputs.summary || 'No detectable change.' }}</summary> | |
``` | |
${{ steps.oasdif_changelog.outputs.changelog }} | |
``` | |
Unexpected changes? Ensure your branch is up-to-date with `main` (consider rebasing). | |
</details> | |
- name: Check for breaking changes | |
id: oasdif_breaking | |
run: | | |
docker run --rm \ | |
--workdir ${{ github.workspace }} \ | |
--volume ${{ github.workspace }}:${{ github.workspace }}:ro \ | |
-e GITHUB_WORKSPACE=${{ github.workspace }} \ | |
tufin/oasdiff breaking \ | |
--fail-on ERR \ | |
--format githubactions \ | |
--composed \ | |
'base/openapi/specs/*.yaml' \ | |
'head/openapi/specs/*.yaml' |