-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.72 KB
/
update-tool-versions.yml
File metadata and controls
54 lines (48 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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