Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/update-version-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: main

- name: Set up Nix
uses: cachix/install-nix-action@v31

- name: Update version dashboard
run: nix-shell --run 'npm run generate:version-compatibility-dashboard'
run: |
nix-shell --run 'npm run generate:version-compatibility-dashboard'
nix-shell --run 'npm run generate:network-variable-tabs'

- name: Detect changes
id: changes
Expand All @@ -47,14 +51,15 @@ jobs:
GH_TOKEN: ${{ github.token }}
PR_BRANCH: version-dashboard/update
PR_TITLE: Update version dashboard data
PR_REVIEWERS: Jatinp26,shreyas-da,hrischuk-da
run: |
set -euo pipefail

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git switch -c "$PR_BRANCH"
git add config/repo-version-config.json docs-main/snippets/generated/version-dashboard-data.mdx
git add config/repo-version-config.json docs-main
git commit -m "$PR_TITLE"

if remote_sha="$(git ls-remote --heads origin "$PR_BRANCH" | awk '{print $1}')" && [[ -n "$remote_sha" ]]; then
Expand All @@ -69,6 +74,7 @@ jobs:

Validation run by the workflow:
- `npm run generate:version-compatibility-dashboard`
- `npm run generate:network-variable-tabs`
- `git diff --check`
EOF

Expand All @@ -83,15 +89,22 @@ jobs:
)"

if [[ -n "$existing_pr_number" ]]; then
pr_number="$existing_pr_number"
gh pr edit "$existing_pr_number" \
--repo "$GITHUB_REPOSITORY" \
--title "$PR_TITLE" \
--body-file "$pr_body"
else
gh pr create \
pr_url="$(gh pr create \
--base main \
--head "$PR_BRANCH" \
--repo "$GITHUB_REPOSITORY" \
--title "$PR_TITLE" \
--body-file "$pr_body"
--body-file "$pr_body")"
pr_number="${pr_url##*/}"
echo "$pr_url"
fi

gh pr edit "$pr_number" \
--repo "$GITHUB_REPOSITORY" \
--add-reviewer "$PR_REVIEWERS"