Fix renaming issues and missing hidden files #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate scripts reference documentation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.sh' # Only run when script files changed | |
- '.github/workflows/internal-scripts-reference-documentation.yml' # or when this file was changed | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**/*.sh' # Only run when script files changed | |
- '.github/workflows/internal-scripts-reference-documentation.yml' # or when this file was changed | |
jobs: | |
reports: | |
runs-on: ubuntu-latest | |
env: | |
CI_COMMIT_MESSAGE: Automated scripts reference document generation (CI) | |
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration | |
steps: | |
- name: Checkout git repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} | |
- name: Generate scripts reference document | |
working-directory: scripts | |
run: | | |
./documentation/generateScriptReference.sh | |
- name: Use git to detect changes in the regenerated document and set generated_document_changed | |
run: git diff --quiet || echo "generated_document_changed=true" >> $GITHUB_ENV | |
- name: Display generated_document_changed | |
run: echo "generated_document_changed=${{ env.generated_document_changed}}" | |
- name: Archive generated scripts reference document | |
if: env.generated_document_changed | |
uses: actions/upload-artifact@v4 | |
with: | |
name: scripts-reference-document | |
path: ./scripts/SCRIPTS.md | |
if-no-files-found: error | |
retention-days: 5 | |
- name: Commit generated scripts reference document if there were changes | |
# Only run when a pull request gets merged or a commit is pushed to the main branch. | |
# And only run when the generated document changed to avoid an empty commit or an error while committing. | |
if: github.event_name == 'push' && env.generated_document_changed | |
run: | | |
git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}' | |
git config --global user.email "[email protected]" | |
git fetch origin | |
git status | |
git add ./scripts/SCRIPTS.md | |
git status | |
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | |
git status | |
git rebase --strategy-option=theirs origin/main --verbose | |
git status | |
git push --verbose |