testing: new release on 2024-12-16 #1139
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: promote-config | |
on: | |
issues: | |
types: [labeled] | |
permissions: | |
contents: read | |
issues: read | |
jobs: | |
promote-config: | |
name: Open promotion pull request | |
if: ${{ github.event.label.name == 'ok-to-promote' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract stream name | |
run: | | |
set -euo pipefail | |
# XXX: consider using separate labels per stream in the future | |
title="${{ github.event.issue.title }}" | |
target_stream=${title%:*} | |
# XXX: fold into promote-config.sh | |
if [ "${target_stream}" == stable ]; then | |
src_stream=testing | |
elif [ "${target_stream}" == testing ]; then | |
src_stream=testing-devel | |
elif [ "${target_stream}" == next ]; then | |
# promote from testing-devel when we are in lockstep | |
enabled="$(curl -L https://raw.githubusercontent.com/coreos/fedora-coreos-pipeline/main/next-devel/status.json | jq .enabled)" | |
case "${enabled}" in | |
true) src_stream=next-devel ;; | |
false) src_stream=testing-devel ;; | |
*) | |
echo "Unexpected value: ${enabled}" | |
exit 1 | |
;; | |
esac | |
echo "Promoting from ${src_stream}" | |
else | |
echo "Title must start with 'stable:', 'testing:', or 'next:'" | |
exit 1 | |
fi | |
echo "target_stream=${title%:*}" >> $GITHUB_ENV | |
echo "src_stream=${src_stream}" >> $GITHUB_ENV | |
- name: Checkout fedora-coreos-config | |
uses: actions/checkout@v3 | |
with: | |
repository: coreos/fedora-coreos-config | |
ref: ${{ env.target_stream }} | |
path: fcos | |
token: ${{ secrets.COREOSBOT_RELENG_TOKEN }} | |
- name: Checkout fedora-coreos-releng-automation | |
uses: actions/checkout@v3 | |
with: | |
repository: coreos/fedora-coreos-releng-automation | |
path: fcos-releng-auto | |
- name: Prepare pull request | |
run: | | |
cd fcos | |
git config user.name 'CoreOS Bot' | |
git config user.email [email protected] | |
../fcos-releng-auto/scripts/promote-config.sh ${src_stream} | |
echo "commit_title=$(git log --pretty=format:%s -1 HEAD)" >> $GITHUB_ENV | |
- name: Open pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.COREOSBOT_RELENG_TOKEN }} | |
path: fcos | |
branch: ${{ env.target_stream }}-promotion | |
push-to-fork: coreosbot-releng/fedora-coreos-config | |
title: "[${{ env.target_stream }}] ${{ env.commit_title }}" | |
body: "Triggered by @${{ github.event.sender.login }} in ${{ github.event.issue.html_url }}." | |
committer: "CoreOS Bot <[email protected]>" | |
author: "CoreOS Bot <[email protected]>" |