forked from AustralianBioCommons/BioShell
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.5 KB
/
Copy pathupdate-tool-versions.yml
File metadata and controls
84 lines (72 loc) · 2.5 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: update-tool-versions
"on":
push:
branches:
- actions-update-versions
schedule:
- cron: "0 3 1 1,7 *"
workflow_dispatch: {}
permissions:
contents: write
pull-requests: write
jobs:
check-and-update:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: pip install pyyaml
- name: Update apt package index
run: sudo apt-get update -qq
- name: Get current year-month
id: date
run: echo "yyyymm=$(date -u +'%Y.%m')" >> "$GITHUB_OUTPUT"
- name: Check tool versions and update tool-versions.yml
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 .github/scripts/check-versions.py "$GITHUB_OUTPUT"
- name: Bump image_version (only if tool versions changed)
if: steps.check.outputs.changes_found == 'true'
id: bump
run: python3 .github/scripts/bump-image-version.py "$GITHUB_OUTPUT"
- name: Read summary for PR body
if: steps.check.outputs.changes_found == 'true'
id: summary
run: |
delimiter=$(openssl rand -hex 8)
{
echo "body<<${delimiter}"
cat version_check_summary.md
echo ""
echo "---"
echo "Image version bumped: \`${{ steps.bump.outputs.old_image_version }}\` -> \`${{ steps.bump.outputs.new_image_version }}\`"
echo "${delimiter}"
} >> "$GITHUB_OUTPUT"
rm -f version_check_summary.md
- name: Create Pull Request
if: steps.check.outputs.changes_found == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: automated/tool-version-updates-${{ steps.date.outputs.yyyymm }}
delete-branch: true
commit-message: "Update tool versions and bump image version"
title: "Tool version updates"
body: ${{ steps.summary.outputs.body }}
add-paths: |
build/ansible/vars/tool-versions.yml
build/openstack-bioshell.pkr.hcl
labels: |
automated
dependencies
- name: No updates found
if: steps.check.outputs.changes_found != 'true'
run: |
echo "All tool versions are already current - no PR needed."
rm -f version_check_summary.md