forked from knative-extensions/net-kourier
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SRVKS-1071] Add github action to sync upstream (#75)
* Add github action to sync upstream release * Update README
- Loading branch information
Showing
2 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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-sandbox/net-kourier.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 |
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