File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,26 @@ runs:
3333 shell : bash
3434 run : sudo apt update && sudo apt install -y xmlstarlet
3535
36- - name : Checkout JUnit reports
36+ - name : Checkout repository
3737 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3838 with :
3939 path : junit-reports
40- ref : ${{ inputs.git-branch }}
41- continue-on-error : true
40+
41+ - name : Create orphaned branch if checkout failed
42+ shell : bash
43+ working-directory : junit-reports
44+ run : |
45+ if git show-ref --verify --quiet refs/remotes/origin/${{ inputs.git-branch }}; then
46+ echo "Switching to branch ${{ inputs.git-branch }}"
47+ git switch ${{ inputs.git-branch }}
48+ else
49+ echo "Creating branch ${{ inputs.git-branch }}"
50+ git switch --orphan ${{ inputs.git-branch }}
51+ git config user.name "${{ github.actor }}"
52+ git config user.email "${{ github.actor }}@users.noreply.github.com"
53+ git commit --allow-empty -m "Initial commit for JUnit reports branch"
54+ git branch --set-upstream-to origin/${{ inputs.git-branch }}
55+ fi
4256
4357 - name : Merge JUnit report artifacts
4458 uses : actions/upload-artifact/merge@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
You can’t perform that action at this time.
0 commit comments