Skip to content

Commit 803eda8

Browse files
committed
Additional changes
1 parent 91413c7 commit 803eda8

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

.github/workflows/create_release_branch.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ jobs:
2929
private-key: ${{ secrets.MONGODB_KUBERNETES_APP_PRIVATE_KEY }}
3030
owner: ${{ github.repository_owner }}
3131

32-
- name: Checkout repository
32+
- name: Checkout repository (master)
33+
if: ${{ github.event.inputs.commit_sha == '' }}
3334
uses: actions/checkout@v4
3435
with:
3536
fetch-depth: 0
3637
token: ${{ steps.app-token.outputs.token }}
37-
ref: ${{ github.head_ref }}
38-
persist-credentials: false
38+
39+
- name: Checkout repository (${{ github.event.inputs.commit_sha }})
40+
if: ${{ github.event.inputs.commit_sha != '' }}
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
token: ${{ steps.app-token.outputs.token }}
45+
ref: ${{ github.event.inputs.commit_sha }}
3946

4047
- name: Check if release branch already exists
4148
id: check-branch
@@ -51,14 +58,8 @@ jobs:
5158
id: create-branch
5259
if: env.create_new_branch == 'true'
5360
run: |
54-
echo "Release branch ${{ github.event.inputs.branch_name }} does not exist. Creating it."
55-
if [ "${{ github.event.inputs.commit_sha }}" != "" ]; then
56-
export "COMMIT_SHA=${{ github.event.inputs.commit_sha }}"
57-
else
58-
export "COMMIT_SHA=$(git rev-parse HEAD)"
59-
fi
60-
git checkout -b ${{ github.event.inputs.branch_name }} $COMMIT_SHA
61-
git push origin ${{ github.event.inputs.branch_name }}
61+
git checkout -b ${{ github.event.inputs.branch_name }}
62+
git push --set-upstream origin ${{ github.event.inputs.branch_name }}
6263
6364
- name: Replace version in release.json
6465
id: replace-version

0 commit comments

Comments
 (0)