-
Notifications
You must be signed in to change notification settings - Fork 46
60 lines (52 loc) · 2.02 KB
/
rhcos_generate.yml
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
name: Generate Images
# Controls when the workflow will run
on:
push:
branches: [ "main" ]
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
inputs: {}
jobs:
generate-table:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate Markdown Table
run: |
sudo apt-get install -y jq
# Generate markdown content
markdown_content=""
markdown_content+="| OCP Version | RHCOS Image File Name |\n"
markdown_content+="| ----------- | --------------------- |\n"
# Iterate through each release version
for version in {18..12}
do
# Fetch object information for the release version
object=$(curl -s "https://raw.githubusercontent.com/openshift/installer/release-4.${version}/data/data/coreos/rhcos.json" | jq -r '.architectures.ppc64le.images.powervs.regions."au-syd".object')
# Append table row to markdown content
markdown_content+="| 4.${version} | ${object} |\n"
done
# Footer
markdown_content+="\n"
markdown_content+="Note: Data sourced from (for each version branch): https://github.com/openshift/installer/blob/master/data/data/coreos/rhcos.json"
markdown_content+="\n"
# Create markdown file
echo -e "${markdown_content}" > ./docs/rhcos-table.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update rhcos-table.md"
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: true
branch: image-patches
delete-branch: true
title: "Update for RHCOS image file names"
body: "This pull request updates the rhcos-table.md file"
labels: |
kind/documentation
documentation
bot
draft: false