Run make generated-files (#3341) #197
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: Generate CI config | |
on: | |
push: | |
branches: | |
- 'release-**' | |
workflow_dispatch: # Manual workflow trigger | |
inputs: | |
branch: | |
required: true | |
description: "SO branch" | |
tag: | |
required: true | |
description: "Promotion tag" | |
jobs: | |
generate-ci: | |
name: generate-ci | |
runs-on: ubuntu-latest | |
env: | |
GOPATH: ${{ github.workspace }} | |
steps: | |
- name: Setup Golang | |
uses: openshift-knative/hack/actions/setup-go@main | |
- name: Checkout openshift-knative/serverless-operator | |
uses: actions/checkout@v4 | |
with: | |
path: ./src/github.com/openshift-knative/serverless-operator | |
- name: Install yq | |
run: | | |
go install github.com/mikefarah/yq/v3@latest | |
- name: Checkout openshift-knative/hack | |
uses: actions/checkout@v4 | |
with: | |
repository: 'openshift-knative/hack' | |
ref: 'main' | |
path: ./src/github.com/openshift-knative/hack | |
- name: Checkout openshift/release | |
uses: actions/checkout@v4 | |
with: | |
branch: 'master' | |
repository: 'openshift/release' | |
path: ./src/github.com/openshift-knative/hack/openshift/release | |
- name: Configure Git user | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "OpenShift Serverless" | |
- name: Generate CI (on workflow dispatch) | |
if: github.event_name == 'workflow_dispatch' | |
working-directory: ./src/github.com/openshift-knative/hack | |
run: go run ./cmd/prowcopy --from-branch ${{ github.ref_name }} --branch ${{ inputs.branch }} --tag ${{ inputs.tag }} --config config/serverless-operator.yaml | |
- name: Generate CI (on branch created) | |
if: github.event_name == 'push' && github.event.created | |
working-directory: ./src/github.com/openshift-knative/hack | |
run: go run ./cmd/prowcopy --branch ${{ github.ref_name }} --tag "release-$(yq read ../serverless-operator/olm-catalog/serverless-operator/project.yaml 'project.version')" --config config/serverless-operator.yaml | |
- name: Generate CI (on push) | |
if: github.event_name == 'push' && github.event.created == false | |
working-directory: ./src/github.com/openshift-knative/hack | |
run: go run ./cmd/prowcopy --from-branch ${{ github.ref_name }} --branch ${{ github.ref_name }} --tag "release-$(yq read ../serverless-operator/olm-catalog/serverless-operator/project.yaml 'project.version')" --config config/serverless-operator.yaml | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.SERVERLESS_QE_ROBOT }} | |
path: ./src/github.com/openshift-knative/hack/openshift/release | |
branch: generate-openshift-knative-serverless-operator-${{ github.ref_name }}-ci-config | |
title: "[${{ github.ref_name }}] Initialize Serverless Operator CI config" | |
commit-message: "[${{ github.ref_name }}] Initialize Serverless Operator CI config" | |
push-to-fork: serverless-qe/release | |
delete-branch: true | |
body: | | |
Serverless Operator CI config for ${{ github.ref_name }}. | |
- name: Trigger Konflux and CI generation | |
if: ${{ always() }} | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.SERVERLESS_QE_ROBOT }} | |
script: | | |
github.rest.actions.createWorkflowDispatch({ | |
owner: context.repo.owner, | |
repo: 'hack', | |
workflow_id: 'release-generate-ci.yaml', | |
ref: 'main', | |
}) |