Skip to content

Commit 971b8ab

Browse files
committed
updated workflow and push changes action
1 parent afbd311 commit 971b8ab

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/actions/push-changes/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
artifact-name:
2121
description: 'Name of the artifact to download before pushing changes.'
2222
required: false
23+
force-checkout:
24+
description: 'Force checkout the target branch, discarding local changes.'
25+
required: false
2326

2427
runs:
2528
using: "composite"
@@ -47,7 +50,7 @@ runs:
4750
- name: Check for changes in ${{ inputs.working-directory }}
4851
shell: bash
4952
run: |
50-
git checkout -b ${{ inputs.target-branch }} origin/${{ inputs.target-branch }} --force
53+
git checkout -b ${{ inputs.target-branch }} origin/${{ inputs.target-branch }} ${{ inputs.force-checkout && '--force' || '' }}
5154
git stash apply
5255
git diff --staged --quiet -- ${{ inputs.working-directory }}
5356
continue-on-error: true

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ jobs:
223223
working-directory: './api-reference/'
224224
target-branch: ${{ github.head_ref || github.ref }}
225225
commit-message: 'Update docs for version ${{ env.friendly-version }}'
226+
force: false
226227
- name: 'Generate assembly metadata'
227228
uses: ./.github/actions/docfx-build
228229
with:

0 commit comments

Comments
 (0)