Skip to content

Commit 6a5468a

Browse files
committed
Accept different branch prefixes for upstream sync
1 parent 1da13c0 commit 6a5468a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/upstream-sync.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ name: Upstream Sync Workflow
77
description: 'The OpenStack release series you wish to sync against.'
88
required: true
99
type: string
10+
branch_prefix:
11+
description: 'The prefix of the upstream branch you want to sync against.'
12+
required: false
13+
type: string
14+
default: stable
1015
env:
1116
GITHUB_TOKEN: ${{github.token}}
1217
DOWNSTREAM_OWNER: stackhpc
@@ -20,7 +25,7 @@ jobs:
2025
run: |
2126
upstream_sha=$(gh api \
2227
-H "Accept: application/vnd.github.v3+json" \
23-
"/repos/${{env.UPSTREAM_OWNER}}/$(basename $(pwd))/commits/stable/${{inputs.release_series}}" --jq ".sha")
28+
"/repos/${{env.UPSTREAM_OWNER}}/$(basename $(pwd))/commits/${{inputs.branch_prefix}}/${{inputs.release_series}}" --jq ".sha")
2429
echo "result=$upstream_sha" >> $GITHUB_OUTPUT
2530
- name: Check if downstream branch exists
2631
id: check_if_downstream_branch_exists
@@ -51,7 +56,7 @@ jobs:
5156
-H "Accept: application/vnd.github.v3+json" \
5257
"/repos/${{env.DOWNSTREAM_OWNER}}/$(basename $(pwd))"\
5358
"/compare/stackhpc/${{inputs.release_series}}..."\
54-
"${{env.UPSTREAM_OWNER}}:stable/${{inputs.release_series}}" --jq '.ahead_by')
59+
"${{env.UPSTREAM_OWNER}}:${{inputs.branch_prefix}}/${{inputs.release_series}}" --jq '.ahead_by')
5560
echo "result=$ahead_by" >> $GITHUB_OUTPUT
5661
- name: Create copy of the upstream branch
5762
if: steps.check_if_ahead.outputs.result > 0

0 commit comments

Comments
 (0)