4
4
workflow_call :
5
5
inputs :
6
6
build-number :
7
- type : number
7
+ type : string
8
8
description : Build number used to build artifact to be promoted
9
9
target-repository :
10
10
type : string
25
25
env :
26
26
JF_URL : ${{ vars.JFROG_PLATFORM_URL }}
27
27
with :
28
- oidc-provider-name : ${{ inputs.oidc-provider }}
29
- oidc-audience : ${{ inputs.oidc-audience }}
28
+ oidc-provider-name : ${{ secrets.JFROG_OIDC_PROVIDER }}
29
+ oidc-audience : ${{ secrets.JFROG_OIDC_AUDIENCE }}
30
30
31
31
- name : Get info
32
32
id : get-build-info
@@ -36,25 +36,43 @@ jobs:
36
36
- name : Get commit hash from repo
37
37
id : get-commit-hash
38
38
run : |
39
- echo commit-hash=$(steps.get-build-info.outputs.build-info | jq -r '.vcs[].revision') >> $GITHUB_OUTPUT
39
+ echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo .vcs[].revision') >> $GITHUB_OUTPUT
40
40
41
- - name : Get commit hash from repo
41
+ - name : Get build name
42
42
id : get-build-name
43
43
run : |
44
- echo build-name=$(steps.get-build-info.outputs.build-info | jq -r '.name') >> $GITHUB_OUTPUT
44
+ echo build-name=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo .name') >> $GITHUB_OUTPUT
45
45
46
46
- name : Debug
47
47
run : |
48
- echo ${{ steps.get-build-info.outputs.build-info }}
49
- echo ${{ steps.get-build-info.outputs.build-name }}
48
+ echo "commit-hash: '${{ steps.get-commit-hash.outputs.commit-hash }}'"
49
+ echo "build-name: '${{ steps.get-build-name.outputs.build-name }}'"
50
+
51
+ # Needed since we are using actions which are part of the repository
52
+ - name : Checkout
53
+ uses : actions/checkout@v4
54
+ with :
55
+ # Fetch the whole history to prevent unrelated history errors
56
+ fetch-depth : " 0"
57
+ ref : ${{ inputs.target-branch }}
58
+ token : ${{ secrets.CLIENT_BOT_PAT }}
59
+
60
+ - name : Fast forward
61
+ shell : bash
62
+ run : git merge --ff-only ${{ inputs.ref-to-merge }}
50
63
51
- - name : Merge commit hash from source to target branch
52
- uses : ./github/actions/fast-forward-merge
64
+ - name : Add tagging message
65
+ uses : stefanzweifel/git-auto-commit-action@v4
53
66
with :
54
- ref-to-merge : ${{ steps.get-build-info.outputs.build-info }}
55
- base-branch : ${{ inputs.target-branch }}
56
- git-bot-token : ${{ secrets.CLIENT_BOT_PAT }}
67
+ commit_message : " Promote to prod [skip ci]"
68
+ commit_author : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
69
+ tagging_message : Promote to PROD
70
+ branch : ${{ inputs.target-branch }}
71
+
72
+ - name : Upload changes to remote head branch
73
+ shell : bash
74
+ run : git push
57
75
58
76
- name : Promote build
59
77
run : |
60
- jf rt build-promote ${{ steps.get-build-info .outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }}
78
+ jf rt build-promote ${{ steps.get-build-name .outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }}
0 commit comments