Skip to content

Commit 557818b

Browse files
🩹 [CI]: Update Build-Docs.yml to use GitHub-Script for committing changes
1 parent 97b6668 commit 557818b

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

‎.github/workflows/Build-Docs.yml‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,28 @@ jobs:
7171
retention-days: 1
7272

7373
- name: Commit all changes
74+
uses: PSModule/GitHub-Script@v1
7475
continue-on-error: true
75-
shell: pwsh
76-
run: |
77-
# Rename the gitignore file to .gitignore.bak
78-
Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force
79-
80-
try {
81-
# Add all changes to the repository
82-
git add .
83-
git commit -m 'Update documentation'
84-
} catch {
85-
Write-Host "No changes to commit"
86-
}
76+
with:
77+
Debug: ${{ inputs.Debug }}
78+
Prerelease: ${{ inputs.Prerelease }}
79+
Verbose: ${{ inputs.Verbose }}
80+
Version: ${{ inputs.Version }}
81+
WorkingDirectory: ${{ inputs.WorkingDirectory }}
82+
Script: |
83+
# Rename the gitignore file to .gitignore.bak
84+
Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force
85+
86+
try {
87+
# Add all changes to the repository
88+
git add .
89+
git commit -m 'Update documentation'
90+
} catch {
91+
Write-Host "No changes to commit"
92+
}
8793
88-
# Restore the gitignore file
89-
Rename-Item -Path '.gitignore.bak' -NewName '.gitignore' -Force
94+
# Restore the gitignore file
95+
Rename-Item -Path '.gitignore.bak' -NewName '.gitignore' -Force
9096
9197
- name: Lint documentation
9298
uses: super-linter/super-linter/slim@latest

0 commit comments

Comments
 (0)