File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 1- name : Build
1+ name : Baseline
22
33on :
44 workflow_dispatch :
@@ -254,18 +254,15 @@ jobs:
254254 - name : Checkout repository
255255 uses : actions/checkout@v3
256256
257- - name : Fetch specific branch
258- run : git fetch origin {{ github.event.inputs.branch_name }}
259-
260- - name : Get the latest commit SHA from the branch
261- id : get_sha
257+ - name : Get the branch name and SHA
262258 run : |
263- branch_sha=$(git rev-parse origin/{{ github.event.inputs.branch_name }})
264- echo "sha=$branch_sha" >> $GITHUB_ENV
265- echo "branch_name={{ github.event.inputs.branch_name }}" >> $GITHUB_ENV
259+ branch_name=${GITHUB_REF#refs/heads/}
260+ commit_sha=$(git rev-parse HEAD)
261+ echo "branch_name=$branch_name" >> $GITHUB_ENV
262+ echo "commit_sha=$commit_sha" >> $GITHUB_ENV
266263
267264 - name : Upload commit SHA as artifact
268265 uses : actions/upload-artifact@v3
269266 with :
270- name : " base-commit-sha-{{ github.event.inputs. branch_name }}"
271- path : <(echo -n $sha) # Directly pass the SHA
267+ name : base-commit-sha-$ {{ env. branch_name }}
268+ path : <(echo -n ${{ env.commit_sha }})
You can’t perform that action at this time.
0 commit comments