-
Notifications
You must be signed in to change notification settings - Fork 20
72 lines (61 loc) · 2.44 KB
/
trigger-operator-builds.yaml
File metadata and controls
72 lines (61 loc) · 2.44 KB
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
name: 1 - Trigger Operator Builds
on:
workflow_dispatch:
inputs:
TARGET_BRANCH:
description: 'RELEASE_BRANCH to checkout (e.g. release-1.17)'
required: true
type: string
permissions: {}
jobs:
prepare-component-builds:
name: Trigger Component Builds for ${{ inputs.TARGET_BRANCH }}
runs-on: ubuntu-22.04
permissions:
contents: write # To push branches
pull-requests: write # To create PRs
steps:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.TARGET_BRANCH }}
- name: Set up Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Update BUILD file
run: make update-build
- name: Prepare metadata for PR
id: metadata
run: |
BUILD=$(cat BUILD)
TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S")
echo "build=$BUILD" >> $GITHUB_OUTPUT
echo "ts=$TIMESTAMP" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(build): bump to ${{ steps.metadata.outputs.build }}"
branch: build/component-${{ steps.metadata.outputs.build }}-${{ steps.metadata.outputs.ts }}
delete-branch: true
title: "chore(build): bump to ${{ steps.metadata.outputs.build }}"
body: |
This PR updates the `BUILD` file with the next operator build version.
**Build:** `${{ steps.metadata.outputs.build }}`
Automatically generated for `${{ inputs.TARGET_BRANCH }}` using GitHub Actions..
labels: |
auto-merge
base: ${{ inputs.TARGET_BRANCH }}
# TODO: migrate to gh cli
# ref: https://github.com/peter-evans/enable-pull-request-automerge?tab=readme-ov-file#enable-pull-request-auto-merge
- name: Enable auto-merge
if: steps.create_pr.outputs.pull-request-number != ''
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GH_TOKEN }}
merge-method: squash
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}