Skip to content

Commit 590ce8a

Browse files
committed
Add CRD sync check badge for olive
Rework the workflow slightly to accommodate implementation via 2 files which will allow both badges to show up in the main README.
1 parent f6b41da commit 590ce8a

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CRD sync check olive branch
2+
3+
on:
4+
schedule:
5+
- cron: '0 */2 * * *' # every 2 hours
6+
workflow_dispatch:
7+
8+
jobs:
9+
call-build-workflow:
10+
if: github.repository_owner == 'openstack-k8s-operators'
11+
uses: ./.github/workflows/crd-sync-check.yaml
12+
with:
13+
branch_name: olive

.github/workflows/crd-sync-check.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ on:
55
schedule:
66
- cron: '0 */2 * * *' # every 2 hours
77
workflow_dispatch:
8+
inputs:
9+
branch_name:
10+
default: 'main'
11+
type: string
12+
workflow_call:
13+
inputs:
14+
branch_name:
15+
default: 'main'
16+
type: string
817

918
jobs:
1019

@@ -14,21 +23,29 @@ jobs:
1423
runs-on: ubuntu-latest
1524

1625
steps:
26+
27+
- name: Set branch
28+
id: set_branch
29+
run: |
30+
BRANCH_NAME="${{ inputs.branch_name || github.ref_name }}"
31+
echo "branch name set to: $BRANCH_NAME"
32+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
33+
1734
- name: Checkout repository
1835
uses: actions/checkout@v4
1936
with:
20-
ref: ${{ github.ref_name }}
37+
ref: ${{ steps.set_branch.outputs.branch_name }}
2138

2239
- name: run make force-bump
2340
shell: bash
2441
run: |
25-
BRANCH='${{ github.ref_name }}' make force-bump
42+
BRANCH='${{ steps.set_branch.outputs.branch_name }}' make force-bump
2643
2744
- name: run make bindata
2845
shell: bash
2946
run: |
3047
make bindata
3148
32-
- name: Fail if there are local CRD changes requiring a CRD sync
49+
- name: Fail if there are local CRD changes in bindata/crds
3350
run: |
3451
git diff --quiet bindata/crds

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# openstack-operator
22

33
[![CodeQL](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/codeql.yml/badge.svg)](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/codeql.yml)
4-
[![CRD sync check](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/crd-sync-check.yaml/badge.svg)](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/crd-sync-check.yaml)
4+
[![CRD sync check main](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/crd-sync-check.yaml/badge.svg)](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/crd-sync-check.yaml)
5+
[![CRD sync check olive](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/crd-sync-check-olive.yaml/badge.svg)](https://github.com/openstack-k8s-operators/openstack-operator/actions/workflows/crd-sync-check-olive.yaml)
56

67
This is the primary operator for OpenStack. It is a "meta" operator, meaning it
78
serves to coordinate the other operators for OpenStack by watching and configuring

0 commit comments

Comments
 (0)