Improve levitate detect breaking changes pipeline (#94391)

* Update .github/workflows/detect-breaking-changes-levitate.yml

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>

---------

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
This commit is contained in:
Esteban Beltran 2024-10-08 14:45:54 +02:00 committed by GitHub
parent 02f5e1f930
commit 84554735b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,10 @@
---
name: Levitate / Detect breaking changes in PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
@ -11,7 +15,7 @@ on:
jobs:
buildPR:
name: Build PR
name: Build PR packages artifacts
runs-on: ubuntu-latest
defaults:
run:
@ -27,7 +31,7 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn cache
uses: actions/cache@v4
@ -57,7 +61,7 @@ jobs:
path: './pr/pr_built_packages.zip'
buildBase:
name: Build Base
name: Build Base packages artifacts
runs-on: ubuntu-latest
defaults:
run:
@ -75,7 +79,7 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn cache
uses: actions/cache@v4
@ -105,7 +109,7 @@ jobs:
path: './base/base_built_packages.zip'
Detect:
name: Detect breaking changes
name: Detect breaking changes between PR and base
runs-on: ubuntu-latest
needs: ['buildPR', 'buildBase']
env:
@ -179,7 +183,7 @@ jobs:
Report:
name: Report breaking changes in PR
name: Report breaking changes in PR comment
runs-on: ubuntu-latest
needs: ['Detect']
@ -234,9 +238,9 @@ jobs:
echo 'levitate_markdown<<EOF'
cat levitate.md
echo EOF
} >> $GITHUB_OUTPUT
} >> "$GITHUB_OUTPUT"
else
echo "levitate_markdown=No breaking changes detected" >> $GITHUB_OUTPUT
echo "levitate_markdown=No breaking changes detected" >> "$GITHUB_OUTPUT"
fi
@ -253,7 +257,6 @@ jobs:
${{ steps.levitate-markdown.outputs.levitate_markdown }}
[Read our guideline](https://github.com/grafana/grafana/blob/main/contribute/breaking-changes-guide/breaking-changes-guide.md)
[Console output](${{ steps.levitate-run.outputs.job_link }})
* Your pull request merge won't be blocked.
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
@ -359,5 +362,6 @@ jobs:
if [ "${{ steps.levitate-run.outputs.exit_code }}" -ne 0 ]; then
echo "Breaking changes detected. Please check the levitate report in your pull request. This workflow won't block merging."
fi
exit ${{ steps.levitate-run.outputs.exit_code }}
shell: bash