-
Notifications
You must be signed in to change notification settings - Fork 17
73 lines (65 loc) · 2.31 KB
/
run-command-repository.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
name: Run Makefile command
on:
workflow_dispatch: # Manual workflow trigger
inputs:
repository:
description: "Repository 'org/name'"
default: "openshift-knative/eventing"
required: true
command:
description: "Command to run"
default: "generate-release"
required: true
branch:
description: "Branch name"
default: "release-v1.11"
required: true
jobs:
run-command:
name: run-command ${{ inputs.repository }} - ${{ inputs.command }}
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ inputs.repository }}
uses: actions/checkout@v4
with:
repository: '${{ inputs.repository }}'
path: "./src/github.com/${{ inputs.repository }}"
ref: "${{ inputs.branch }}"
- name: Setup Golang
uses: actions/setup-go@v5
with:
cache: false
go-version-file: "./src/github.com/${{ inputs.repository }}/go.mod"
- name: Install prerequisites
env:
YQ_VERSION: 3.4.0
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
sudo mv /usr/bin/yq /usr/local/bin/yq
- name: Configure Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "OpenShift Serverless"
- name: Generate release
working-directory: "./src/github.com/${{ inputs.repository }}"
run: make ${{ inputs.command }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.SERVERLESS_QE_ROBOT }}
path: "./src/github.com/${{ inputs.repository }}"
base: ${{ inputs.branch }}
branch: run-command-${{ inputs.branch }}-${{ inputs.command }}
title: "[${{ inputs.branch }}] Run `make ${{ inputs.command }}`"
commit-message: "Run `make ${{ inputs.command }}`"
delete-branch: true
body: |
Run `make ${{ inputs.command }}` using openshift-knative/hack.
- name: Debug
if: always()
working-directory: "./src/github.com/${{ inputs.repository }}"
run: |
tree
git --no-pager diff