-
Notifications
You must be signed in to change notification settings - Fork 15
45 lines (43 loc) · 1.35 KB
/
update-constants.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
name: Update constants from RPM sources
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
jobs:
update-constants:
# To not run in forks
if: github.repository_owner == 'packit'
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Python dependencies
run: pip install --upgrade click pyparsing
- name: Checkout RPM source tree
uses: actions/checkout@v3
with:
repository: "rpm-software-management/rpm"
path: "rpm-source-tree"
- name: Update constants
id: update_constants
run: |
python scripts/update_constants.py specfile/constants.py rpm-source-tree/
case $? in
0) echo "pr=true" >> $GITHUB_OUTPUT;;
100) echo "pr=false" >> $GITHUB_OUTPUT; exit 0;;
*) exit $?;;
esac
- name: Create Pull Request
if: steps.update_constants.outputs.pr == 'true'
uses: peter-evans/create-pull-request@v4
with:
add-paths: specfile/constants.py
commit-message: Update constants
title: Update constants
body: Update `specfile/constants.py` from RPM sources
delete-branch: true