Add git history file overview treemap #60
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 environment variables reference documentation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.sh' # Only run when script files changed | |
- '.github/workflows/environment-internal-variables-reference-documentation.yml' # or when this file was changed | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**/*.sh' # Only run when script files changed | |
- '.github/workflows/environment-internal-variables-reference-documentation.yml' # or when this file was changed | |
jobs: | |
reports: | |
runs-on: ubuntu-latest | |
env: | |
CI_COMMIT_MESSAGE: Automated environment variables documentation 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 environment variables reference document | |
working-directory: scripts | |
run: | | |
./documentation/generateEnvironmentVariableReference.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 environment variables reference document | |
if: env.generated_document_changed | |
uses: actions/upload-artifact@v4 | |
with: | |
name: environment-variables-reference-document | |
path: ./scripts/ENVIRONMENT_VARIABLES.md | |
if-no-files-found: error | |
retention-days: 5 | |
- name: Commit generated environment variables 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: | | |
set -x | |
git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}' | |
git config --global user.email "[email protected]" | |
git fetch origin | |
git status | |
git add ./scripts/ENVIRONMENT_VARIABLES.md | |
git status | |
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | |
git status | |
git rebase --strategy-option=theirs origin/main --verbose | |
git status | |
git add ./scripts/ENVIRONMENT_VARIABLES.md | |
git status | |
git commit --amend --no-edit | |
git status | |
git push --verbose |