-
Notifications
You must be signed in to change notification settings - Fork 155
81 lines (75 loc) · 3.21 KB
/
remove-graduated-overrides.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Remove graduated overrides
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
buildmatrix:
name: "Build job matrix"
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.build.outputs.matrix}}
steps:
- name: Build job matrix
id: build
run: |
set -xeuo pipefail
branches=(testing-devel branched rawhide)
enabled="$(curl -L https://raw.githubusercontent.com/coreos/fedora-coreos-pipeline/main/next-devel/status.json | jq .enabled)"
case "${enabled}" in
true) branches+=(next-devel) ;;
false) ;;
*)
echo "Unexpected value: ${enabled}"
exit 1
;;
esac
echo "matrix=$(xargs -n 1 echo <<< "${branches[@]}" | jq -cnR '[inputs]')" >> $GITHUB_OUTPUT
remove-graduated-overrides:
name: Remove graduated overrides
needs: buildmatrix
runs-on: ubuntu-latest
# TODO: use cosa directly here
# https://github.com/coreos/coreos-assembler/issues/2223
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
strategy:
matrix:
branch: ${{fromJson(needs.buildmatrix.outputs.matrix)}}
fail-fast: false
steps:
- name: Enable CoreOS continuous repo
run: |
version_id=$(. /etc/os-release && echo ${VERSION_ID})
echo -e "[f${version_id}-coreos-continuous]\nenabled=1\nmetadata_expire=1m\nbaseurl=https://kojipkgs.fedoraproject.org/repos-dist/f${version_id}-coreos-continuous/latest/\$basearch/\ngpgcheck=0\nskip_if_unavailable=False\n" > /etc/yum.repos.d/coreos.repo
- name: Install dependencies
run: dnf install -y python3-bodhi-client rpm-ostree # see related TODO above
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
# https://github.com/actions/checkout/issues/766
- name: Mark git checkout as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Remove graduated overrides
run: |
git config user.name 'CoreOS Bot'
git config user.email coreosbot@fedoraproject.org
ci/overrides.py graduate
- name: Create commit
run: |
if ! git diff --quiet --exit-code; then
git commit -am "lockfiles: drop graduated overrides 🎓" \
-m "Triggered by remove-graduated-overrides GitHub Action."
fi
- name: Open pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.COREOSBOT_RELENG_TOKEN }}
branch: ${{ matrix.branch }}-graduation
push-to-fork: coreosbot-releng/fedora-coreos-config
title: "[${{ matrix.branch }}] lockfiles: drop graduated overrides 🎓"
body: "Created by remove-graduated-overrides [GitHub workflow](${{ github.server_url }}/${{ github.repository }}/actions/workflows/remove-graduated-overrides.yml) ([source](${{ github.server_url }}/${{ github.repository }}/blob/testing-devel/.github/workflows/remove-graduated-overrides.yml))."
committer: "CoreOS Bot <coreosbot@fedoraproject.org>"
author: "CoreOS Bot <coreosbot@fedoraproject.org>"