@@ -3,12 +3,6 @@ author: 'Pete Sramek'
33description : ' Push changes to a specified branch in the repository.'
44inputs :
55 # Required
6- artifact-name :
7- description : ' Name of the artifact to download before pushing changes.'
8- required : true
9- working-directory :
10- description : ' The working directory where the changes will be pushed from.'
11- required : true
126 commit-message :
137 description : ' The commit message to use when pushing changes.'
148 required : true
@@ -17,9 +11,18 @@ inputs:
1711 description : ' .NET SDK version. Default: 9.x'
1812 required : false
1913 default : ' 9.x'
14+ artifact-name :
15+ description : ' Name of the artifact to download before pushing changes. Default: '''' '
16+ required : false
17+ default : ' '
18+ working-directory :
19+ description : ' The working directory where the changes will be pushed from. Default '' .'' '
20+ required : false
21+ default : ' .'
2022 target-branch :
21- description : ' The branch to push changes to.'
23+ description : ' The branch to push changes to.. Default: '''' '
2224 required : false
25+ default : ' '
2326
2427runs :
2528 using : " composite"
3336 dotnet-version : ${{ env.dotnet-sdk-version }}
3437
3538 - name : Download a single artifact
39+ if : ${{ inputs.artifact-name != '' }}
3640 uses : actions/download-artifact@v4
3741 with :
3842 name : ${{ inputs.artifact-name }}
9296 git commit -m '${{ inputs.commit-message }}'
9397 git pull --rebase origin ${{ github.head_ref || github.ref }}
9498 git push
95- working-directory : ${{ inputs.working-directory }}
96-
97- # - name: Add changes from ${{ inputs.working-directory }}
98- # shell: bash
99- # run: |
100- # git fetch origin
101- # git config --global user.name "${{ github.actor }}"
102- # git config --global user.email "${{ github.actor }}@users.noreply.github.com"
103- # git add -- ${{ inputs.working-directory }}
104- # - name: Create or switch to ${{ inputs.target-branch }}
105- # if: ${{ inputs.target-branch != '' }}
106- # shell: bash
107- # run: |
108- # git fetch origin
109- # git stash push --keep-index -- ${{ inputs.working-directory }}
110- # if git show-ref --verify --quiet refs/heads/${{ inputs.target-branch }}; then
111- # echo "Branch ${{ inputs.target-branch }} already exists, switching to it."
112- # git checkout ${{ inputs.target-branch }} --force
113- # else
114- # echo "Branch ${{ inputs.target-branch }} does not exist, creating it."
115- # git checkout -b ${{ inputs.target-branch }} origin/${{ inputs.target-branch }} --force || git checkout -b ${{ inputs.target-branch }} --force
116- # fi
117- # git stash apply
118- # - name: Check for changes in ${{ inputs.working-directory }}
119- # shell: bash
120- # run: |
121- # git diff --staged --quiet -- ${{ inputs.working-directory }}
122- # continue-on-error: true
123- # id: check-diff
124- # - name: Push changes to ${{ inputs.target-branch }}, if exists
125- # if: ${{ steps.check-diff.outcome == 'success' }}
126- # shell: bash
127- # run: |
128- # echo "No changes to commit in ${{ inputs.working-directory }}"
129- # - name: Push changes to ${{ inputs.target-branch }}, if exists
130- # if: ${{ steps.check-diff.outcome == 'failure' }}
131- # shell: bash
132- # run: |
133- # git reset --hard
134- # git stash pop
135- # git commit -m'${{ inputs.commit-message }}' -- ${{ inputs.working-directory }}
136- # git push
137- # - name: Reset branch to ${{ github.ref }}
138- # shell: bash
139- # run: |
140- # git checkout ${{ github.ref }}
99+ working-directory : ${{ inputs.working-directory }}
0 commit comments