Add cmd/konflux to generate some content for konflux-enabled repository… #1
This file contains hidden or 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: Generate konflux configurations | |
on: | |
push: | |
branches: | |
- 'main' | |
schedule: | |
- cron: "0 6 * * *" # Daily at 06:00. | |
workflow_dispatch: # Manual workflow trigger | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-matrix: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere | |
steps: | |
- id: set-matrix | |
run: | | |
echo "projects=$(go run ./cmd/matrix config/konflux/*)" >> $GITHUB_OUTPUT | |
outputs: | |
projects: ${{ steps.set-matrix.outputs.projects }} | |
update-project: | |
needs: build-matrix | |
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: ${{ fromJSON(needs.build-matrix.outputs.projects) }} | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Clone {{.project}} | |
uses: actions/checkout@v4 | |
with: | |
repository: openshift-pipelines/{{.project}} | |
path: project | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Generate configurations | |
run: | | |
go run ./cmd/konflux/ -target project -config config/konflux/{{.project}}.yaml | |
pushd {{.project}} | |
git diff | |
popd |