File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : ' Configure git identity'
2+ author : ' Pete Sramek'
3+ description : ' Configures git user name and email from the last commit.'
4+
5+ runs :
6+ using : composite
7+ steps :
8+ - name : ' Configure git identity'
9+ shell : bash
10+ run : |
11+ git config user.name "$(git log -n 1 --pretty=format:%an)"
12+ git config user.email "$(git log -n 1 --pretty=format:%ae)"
Original file line number Diff line number Diff line change @@ -87,12 +87,14 @@ runs:
8787 set -e
8888 working-directory : ${{ inputs.working-directory }}
8989
90+ - name : Configure git identity
91+ if : ${{ fromJSON(steps.validate.outputs.has-changes) == '1' }}
92+ uses : ' ./.github/actions/git/configure-identity'
93+
9094 - name : Push changes to ${{ github.head_ref || github.ref }}
9195 if : ${{ fromJSON(steps.validate.outputs.has-changes) == '1' }}
9296 shell : bash
9397 run : |
94- git config user.name "$(git log -n 1 --pretty=format:%an)"
95- git config user.email "$(git log -n 1 --pretty=format:%ae)"
9698 git commit -m '${{ inputs.commit-message }}'
9799 git pull --rebase origin ${{ github.head_ref || github.ref }}
98100 git push
Original file line number Diff line number Diff line change 2525 echo "notes-start-tag=${{ inputs.notes-start-tag }}"
2626 echo "notes-start-tag-argument=${{ inputs.notes-start-tag != '' && format('--notes-start-tag {0}', inputs.notes-start-tag) || '' }}"
2727 shell: bash
28+ - name : ' Configure git identity'
29+ uses : ' ./.github/actions/git/configure-identity'
2830 - name : ' Create git tag ${{ inputs.release-version }}'
2931 shell : bash
3032 run : |
Original file line number Diff line number Diff line change 3030 token : ${{ secrets.GH_ADMIN_TOKEN }}
3131
3232 - name : ' Configure git'
33- run : |
34- git config user.name "$(git log -n 1 --pretty=format:%an)"
35- git config user.email "$(git log -n 1 --pretty=format:%ae)"
33+ uses : ' ./.github/actions/git/configure-identity'
3634
3735 - name : ' Resolve backtrack targets'
3836 id : targets
Original file line number Diff line number Diff line change @@ -113,9 +113,7 @@ jobs:
113113 dotnet-version : ${{ env.dotnet-sdk-version }}
114114
115115 - name : ' Configure git'
116- run : |
117- git config user.name "$(git log -n 1 --pretty=format:%an)"
118- git config user.email "$(git log -n 1 --pretty=format:%ae)"
116+ uses : ' ./.github/actions/git/configure-identity'
119117
120118 - name : ' Create develop branch from main'
121119 run : |
Original file line number Diff line number Diff line change 6060 target-branch-exists : ${{ steps.check-target-branch-exists.outputs.target-branch-exists }}
6161 pull-request-exists : ${{ steps.check-pull-request-exists.outputs.pull-request-exists }}
6262 steps :
63+ - name : ' Checkout ${{ github.head_ref || github.ref }}'
64+ uses : actions/checkout@v6
6365 - name : ' Set target branch'
6466 id : set-target-branch
6567 run : |
@@ -211,17 +213,12 @@ jobs:
211213 run : |
212214 git fetch origin
213215 git push origin origin/${{ env.base-branch }}:refs/heads/${{ env.target-branch }}
214- - name : ' Lock target branch'
215- if : ${{ needs.workflow-variables.outputs.target-branch-exists == 'false' }}
216- uses : ' ./.github/actions/github/branch-protection/lock'
217- with :
218- branch : ${{ needs.workflow-variables.outputs.target-branch }}
219- token : ${{ secrets.GH_ADMIN_TOKEN }}
220216 - name : ' Create PR: "Promote ${{ env.current-branch }} to ${{ env.target-branch }}"'
221217 if : ${{ needs.workflow-variables.outputs.pull-request-exists == 'false' }}
222218 env :
223219 GH_TOKEN : ${{ github.token }}
224220 current-branch : ${{ github.ref_name }}
225221 target-branch : ${{ needs.workflow-variables.outputs.target-branch }}
226222 run : |
223+ git fetch origin ${{ env.target-branch }}
227224 gh pr create --title "Promote ${{ env.current-branch }} to ${{ env.target-branch }}" --fill --base ${{ env.target-branch }} --head ${{ env.current-branch }}
Original file line number Diff line number Diff line change 88 - synchronize
99 - reopened
1010 branches :
11+ - ' develop/**'
1112 - ' preview/**'
12- - ' release/**'
13+ - ' release/**'
1314
1415permissions :
1516 actions : read
Original file line number Diff line number Diff line change @@ -358,11 +358,13 @@ jobs:
358358 echo "support-branch-exists=false" >> $GITHUB_OUTPUT
359359 fi
360360
361+ - name : ' Configure git identity'
362+ if : ${{ steps.check-support-branch.outputs.support-branch-exists == 'false' }}
363+ uses : ' ./.github/actions/git/configure-identity'
364+
361365 - name : ' Create support branch'
362366 if : ${{ steps.check-support-branch.outputs.support-branch-exists == 'false' }}
363367 run : |
364- git config user.name "$(git log -n 1 --pretty=format:%an)"
365- git config user.email "$(git log -n 1 --pretty=format:%ae)"
366368 git checkout -b "${{ steps.resolve-support-branch.outputs.support-branch }}"
367369 git push --set-upstream origin "${{ steps.resolve-support-branch.outputs.support-branch }}"
368370
You can’t perform that action at this time.
0 commit comments