-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/konflux: add support for release branches
Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
b43763b
commit 8e5ab6b
Showing
3 changed files
with
57 additions
and
28 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: update-sources | ||
name: update-sources-{{.Branch}} | ||
|
||
on: | ||
workflow_dispatch: {} | ||
|
@@ -21,12 +21,15 @@ jobs: | |
run: | | ||
rm -fR upstream | ||
git clone https://github.com/{{.Upstream}} upstream | ||
pushd upstream | ||
git checkout -b {{.UpstreamBranch}} origin/{{.UpstreamBranch}} | ||
popd | ||
- name: Commit new changes | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git checkout -b actions/update/sources-main | ||
git checkout -b actions/update/sources-{{.Branch}} | ||
pushd upstream | ||
OLD_COMMIT=$(cat ../head) | ||
NEW_COMMIT=$(git rev-parse HEAD) | ||
|
@@ -49,13 +52,13 @@ jobs: | |
https://github.com/{{.Upstream}}/compare/${NEW_COMMIT}..${OLD_COMMIT} | ||
EOF | ||
git push -f origin actions/update/sources-main | ||
git push -f origin actions/update/sources-{{.Branch}} | ||
- name: Create pull request | ||
run: | | ||
if [ "$(gh pr list --base main --head actions/update/sources-main --json url --jq 'length')" = "0" ]; then | ||
if [ "$(gh pr list --base {{.Branch}} --head actions/update/sources-{{.Branch}} --json url --jq 'length')" = "0" ]; then | ||
echo "creating PR..." | ||
gh pr create -B main -H actions/update/sources-main --fill | ||
gh pr create -B {{.Branch}} -H actions/update/sources-{{.Branch}} --fill | ||
else | ||
echo "a PR already exists, skipping..." | ||
fi | ||
|
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 |
---|---|---|
|
@@ -9,3 +9,6 @@ components: | |
- sidecarlogresults | ||
- webhook | ||
- workingdirinit | ||
branches: | ||
- version: 1.16 | ||
upstream: release-v0.62.x |