Remove graduated overrides #5184
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
submodules: true | |
# 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 [email protected] | |
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 <[email protected]>" | |
author: "CoreOS Bot <[email protected]>" |