Add a page dedicated to examples in the Foundation SDK docs #830
Workflow file for this run
This file contains 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: Foundation-sdk diff preview | |
on: | |
pull_request: ~ | |
env: | |
DEVBOX_VERSION: 0.13.1 | |
jobs: | |
sdk_diff: | |
name: Generate diff | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore go vendors | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: go-deps-${{ runner.os }}-next-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go-deps-${{ runner.os }} | |
- name: Install devbox | |
uses: jetify-com/[email protected] | |
with: | |
enable-cache: 'true' | |
devbox-version: ${{ env.DEVBOX_VERSION }} | |
- name: Dry-run release | |
shell: bash | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "cog - CI" | |
devbox run ./scripts/release-version.sh next next | |
env: | |
FOUNDATION_SDK_PATH: ./grafana-foundation-sdk | |
FOUNDATION_SDK_REPO: https://github.com/grafana/grafana-foundation-sdk.git | |
LOG_LEVEL: '7' # debug | |
GOGC: 'off' | |
- name: Preview diff | |
run: | | |
cd ./grafana-foundation-sdk | |
echo -e '<!-- grafana-foundation-sdk-diff-preview-marker -->\n\n' >> preview.md | |
echo -e '**Note:** in addition to the changes introduced by this PR, the diff includes unreleased changes living in `main`. \n\n' >> preview.md | |
echo -e "<details>\n" >> preview.md | |
echo -e "<summary>\n" >> preview.md | |
echo -e '### 🔎 Changes to `grafana-foundation-sdk@next+cog-v0.0.x`\n' >> preview.md | |
echo -e "</summary>\n" >> preview.md | |
echo '```patch' >> preview.md | |
git diff next+cog-v0.0.x..HEAD ':(exclude,glob)*/README.md' ':(exclude)java/gradle.properties' ':(exclude)python/pyproject.toml' ':(exclude)typescript/package.json' | tee -a preview.md | |
echo '```' >> preview.md | |
echo -e "\n" >> preview.md | |
echo -e "</details>\n\n" >> preview.md | |
- name: Find preview comment | |
uses: peter-evans/find-comment@v3 | |
id: preview-comment-find | |
if: "!contains(github.actor, 'dependabot') && github.repository == 'grafana/cog'" # only run on main repo, and not on dependabot PRs | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: 'grafana-foundation-sdk-diff-preview-marker' | |
- name: Upsert preview comment | |
uses: peter-evans/create-or-update-comment@v4 | |
if: "!contains(github.actor, 'dependabot') && github.repository == 'grafana/cog'" # only run on main repo, and not on dependabot PRs | |
with: | |
comment-id: ${{ steps.preview-comment-find.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
edit-mode: replace | |
body-path: './grafana-foundation-sdk/preview.md' |