-
Notifications
You must be signed in to change notification settings - Fork 157
66 lines (59 loc) · 2.31 KB
/
bump-fedora-bootc.yaml
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
name: Bump fedora-bootc submodule
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
bump-fedora-bootc-submodule:
name: Bump fedora-bootc submodule
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
# https://github.com/actions/checkout/issues/766
- name: Mark git checkout as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check if there are new commits
run: |
previous_rev=$(git -C fedora-bootc rev-parse HEAD)
git submodule update --remote fedora-bootc
new_rev=$(git -C fedora-bootc rev-parse HEAD)
if [ "${previous_rev}" != "${new_rev}" ]; then
if git -C fedora-bootc diff --quiet "${previous_rev}" "${new_rev}" tier-0 tier-x; then
# reset back any changes to avoid a PR bump
git submodule update
fi
fi
if git diff --quiet --exit-code; then
echo "No tier-0 or tier-x changes; exiting"
exit 0
fi
git -C fedora-bootc shortlog --no-merges "${previous_rev}..${new_rev}" -- tier-0 tier-x > $RUNNER_TEMP/shortlog
marker=END-OF-LOG-MARKER-$RANDOM$RANDOM$RANDOM
cat >> $GITHUB_ENV <<EOF
SHORTLOG<<$marker
$(cat $RUNNER_TEMP/shortlog)
$marker
EOF
- name: Open pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.COREOSBOT_RELENG_TOKEN }}
push-to-fork: coreosbot-releng/fedora-coreos-config
branch: bump-fedora-bootc
commit-message: |
Bump fedora-bootc submodule
${{ env.SHORTLOG }}
title: "Bump fedora-bootc submodule"
body: |
Created by [GitHub workflow](${{ github.server_url }}/${{ github.repository }}/actions/workflows/bump-fedora-bootc.yml) ([source](${{ github.server_url }}/${{ github.repository }}/blob/testing-devel/.github/workflows/bump-fedora-bootc.yml)).
```
${{ env.SHORTLOG }}
```
committer: "CoreOS Bot <[email protected]>"
author: "CoreOS Bot <[email protected]>"