Update Tool Versions Page #3
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: Update Tool Versions Page | |
| on: | |
| schedule: | |
| # Daily at 7:00 AM UTC (1h after Monday dev-toolchain builds) | |
| - cron: '0 7 * * *' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-versions: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Generate tool versions page | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| bash .github/scripts/generate-versions-page.sh \ | |
| > content/docs/container/versions.md | |
| - name: Check for changes | |
| id: diff | |
| run: | | |
| if git diff --quiet content/docs/container/versions.md; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create pull request | |
| if: steps.diff.outputs.changed == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| branch="auto/update-tool-versions" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -B "$branch" | |
| git add content/docs/container/versions.md | |
| git commit -m "docs(container): update tool versions page" | |
| git push -f origin "$branch" | |
| if ! gh pr list --head "$branch" --state open --json number -q '.[0].number' | grep -q .; then | |
| gh pr create \ | |
| --title "docs(container): update tool versions page" \ | |
| --body "Automated daily update of tool versions from the latest dev-toolchain release." \ | |
| --head "$branch" \ | |
| --base main | |
| fi |