@@ -29,13 +29,20 @@ jobs:
29
29
private-key : ${{ secrets.MONGODB_KUBERNETES_APP_PRIVATE_KEY }}
30
30
owner : ${{ github.repository_owner }}
31
31
32
- - name : Checkout repository
32
+ - name : Checkout repository (master)
33
+ if : ${{ github.event.inputs.commit_sha == '' }}
33
34
uses : actions/checkout@v4
34
35
with :
35
36
fetch-depth : 0
36
37
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 }}
39
46
40
47
- name : Check if release branch already exists
41
48
id : check-branch
51
58
id : create-branch
52
59
if : env.create_new_branch == 'true'
53
60
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 }}
62
63
63
64
- name : Replace version in release.json
64
65
id : replace-version
0 commit comments