-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (53 loc) · 1.73 KB
/
update-sources.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: update-sources
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
inputs:
ref:
description: Branch, tag or SHA to checkout
required: true
default: main
jobs:
update-sources:
runs-on: ubuntu-latest
strategy:
matrix:
release:
- '2023.1'
- '2023.2'
- '2024.1'
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || 'main' }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Get old config checksum
id: old_config
run: |
echo checksum=$(sha256sum releases/${{ matrix.release }}/config.yml | awk '{ print $1 }') >> $GITHUB_OUTPUT
- name: Update sources
run: |
python kolla-builder.py update-sources -i releases/${{ matrix.release }}/config.yml -o releases/${{ matrix.release }}/config.yml
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Get new config checksum
id: new_config
run: |
echo checksum=$(sha256sum releases/${{ matrix.release }}/config.yml | awk '{ print $1 }') >> $GITHUB_OUTPUT
- name: Create Pull Request
if: ${{ steps.new_config.outputs.checksum != steps.old_config.outputs.checksum }}
uses: peter-evans/create-pull-request@v6
with:
commit-message: "feat: update sources for ${{ matrix.release }}"
delete-branch: true
branch: feat/bump-sources-${{ matrix.release }}
title: "⚙️ ${{ matrix.release }}: update sources"
body: |
This is an automatic pull request