Skip to content

Commit 2f69257

Browse files
no-jira: Allow branch configuration for release actions
1 parent 9357373 commit 2f69257

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ on:
2626
codeflare-repository-organization:
2727
type: string
2828
default: "project-codeflare"
29-
30-
env:
31-
PR_BRANCH_NAME: snyk-tag-monitoring-${{ github.run_id }}
29+
release-branch:
30+
type: string
31+
description: 'Branch to release from (default: main)'
32+
required: false
33+
default: 'main'
3234

3335
jobs:
3436
release:
@@ -42,6 +44,7 @@ jobs:
4244
- name: Checkout the repository
4345
uses: actions/checkout@v4
4446
with:
47+
ref: ${{ github.event.inputs.release-branch }}
4548
token: ${{ secrets.GH_CLI_TOKEN }}
4649
- name: Install Python
4750
uses: actions/setup-python@v5
@@ -59,7 +62,7 @@ jobs:
5962
run: |
6063
gh workflow run publish-documentation.yaml \
6164
--repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-sdk \
62-
--ref ${{ github.ref }} \
65+
--ref ${{ github.event.inputs.release-branch }} \
6366
--field codeflare_sdk_release_version=${{ github.event.inputs.release-version }}
6467
env:
6568
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
@@ -81,7 +84,7 @@ jobs:
8184
run: |
8285
gh workflow run odh-notebooks-sync.yml \
8386
--repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-sdk \
84-
--ref ${{ github.ref }} \
87+
--ref ${{ github.event.inputs.release-branch }} \
8588
--field upstream-repository-organization=opendatahub-io \
8689
--field codeflare-repository-organization=${{ github.event.inputs.codeflare-repository-organization }} \
8790
--field codeflare_sdk_release_version=${{ github.event.inputs.release-version }}

.github/workflows/update-versions.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ on:
3333
required: false
3434
type: string
3535
default: ''
36+
target-branch:
37+
type: string
38+
description: 'Target branch to update and create PR against (default: main)'
39+
required: false
40+
default: 'main'
3641

3742
env:
3843
PR_BRANCH_NAME: ray-version-update-${{ github.run_id }}
@@ -60,8 +65,8 @@ jobs:
6065
run: |
6166
git config --local user.email "[email protected]"
6267
git config --local user.name "GitHub Action"
63-
git checkout main
64-
git pull origin main
68+
git checkout ${{ github.event.inputs.target-branch }}
69+
git pull origin ${{ github.event.inputs.target-branch }}
6570
git checkout -b ${{ env.PR_BRANCH_NAME }}
6671
6772
- name: Update constants.py
@@ -323,7 +328,7 @@ jobs:
323328
gh pr create \
324329
--title "$PR_TITLE" \
325330
--body "$PR_BODY" \
326-
--base main \
331+
--base ${{ github.event.inputs.target-branch }} \
327332
--head ${{ env.PR_BRANCH_NAME }}
328333
env:
329334
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)