forked from knative/serving
-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (51 loc) · 1.72 KB
/
sync-upstream.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
---
name: Sync upstream
on:
workflow_dispatch: # Manual workflow trigger
inputs:
release:
type: string
required: true
description: Release Version
jobs:
sync-upstream:
if: github.event.created || github.event_name == 'workflow_dispatch'
name:
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
UPSTREAM: https://github.com/knative/serving.git
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ./src/github.com/${{ github.repository }}
fetch-depth: 0
ref: ${{ inputs.release }}
- name: Sync upstream
working-directory: ./src/github.com/${{ github.repository }}
run: |
if ! git config user.name > /dev/null; then
git config user.name "John Doe"
fi
if ! git config user.email > /dev/null; then
git config user.email "johndoe@localhost"
fi
git remote add upstream "${UPSTREAM}"
git fetch upstream
BRANCH=${{ inputs.release }}
git merge upstream/"release-${BRANCH#release-v}"
shell: bash
- name: Regenerate all generated files
working-directory: ./src/github.com/${{ github.repository }}
run: ./openshift/release/generate-release.sh ${{ inputs.release }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
path: ./src/github.com/${{ github.repository }}
branch: auto/sync-upstream-${{ inputs.release }}
title: "[${{ inputs.release }}] Sync upstream release"
commit-message: "Sync upstream release"
delete-branch: true
body: |
Sync upstream release