This repository has been archived by the owner on May 28, 2024. It is now read-only.
centos-bootc:stream9 trigger #9
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: CentOS Stream 9 trigger | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 3 * * *' | |
jobs: | |
check-image: | |
# Do not run this job on any fork repos | |
if: github.repository == 'virt-s1/bootc-workflow-test' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check CentOS Stream 9 image info | |
id: check_image_cs9 | |
run: | | |
IMAGE_DIGEST=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Digest') | |
IMAGE_VERSION=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Labels.version') | |
KERNEL_VERSION=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Labels."ostree.linux"') | |
COMPOSE_ID=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Labels."redhat.compose-id"') | |
echo "image_digest=$IMAGE_DIGEST" >> $GITHUB_OUTPUT | |
echo "image_version=$IMAGE_VERSION" >> $GITHUB_OUTPUT | |
echo "kernel_version=$KERNEL_VERSION" >> $GITHUB_OUTPUT | |
echo "compose_id=$COMPOSE_ID" >> $GITHUB_OUTPUT | |
outputs: | |
image_digest: ${{ steps.check_image_cs9.outputs.image_digest }} | |
image_version: ${{ steps.check_image_cs9.outputs.image_version }} | |
kernel_version: ${{ steps.check_image_cs9.outputs.kernel_version }} | |
compose_id: ${{ steps.check_image_cs9.outputs.compose_id }} | |
create-pr: | |
needs: check-image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Save tested container image digest | |
run: echo "${{ needs.check-image.outputs.image_digest }}" >> files/pr_file | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "CentOS Stream 9 - ${{ needs.check-image.outputs.image_version }} - ${{ steps.date.outputs.date }}" | |
committer: cloudkitebot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
branch: cpr | |
branch-suffix: random | |
delete-branch: true | |
title: "CentOS Stream 9 - ${{ needs.check-image.outputs.image_version }} - ${{ steps.date.outputs.date }}" | |
labels: auto-merge,CentOS-Stream-9 | |
body: | | |
CentOS Stream 9 image ${{ needs.check-image.outputs.image_version }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Image URL: quay.io/centos-bootc/centos-bootc:stream9 | |
- Image Digest: ${{ needs.check-image.outputs.image_digest }} | |
- Image Version: ${{ needs.check-image.outputs.image_version }} | |
- Kernel Version: ${{ needs.check-image.outputs.kernel_version }} | |
- Compose ID: ${{ needs.check-image.outputs.compose_id }} | |
- name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: rebase | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /test-cs9 | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: bootc test | |
column-name: CentOS-Stream-9 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} |