Add git history file overview treemap #25
This file contains 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 cypher reference documentation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.cypher' # Only run when cypher files changed | |
- '.github/workflows/internal-cypher-reference-documentation.yml' # or when this file was changed | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**/*.cypher' # Only run when cypher files changed | |
- '.github/workflows/internal-cypher-reference-documentation.yml' # or when this file was changed | |
jobs: | |
reports: | |
runs-on: ubuntu-latest | |
env: | |
CI_COMMIT_MESSAGE: Automated cypher 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 cypher reference document | |
working-directory: cypher | |
run: | | |
./../scripts/documentation/generateCypherReference.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 cypher reference document | |
if: env.generated_document_changed | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypher-reference-document | |
path: ./cypher/CYPHER.md | |
if-no-files-found: error | |
retention-days: 5 | |
- name: Commit generated cypher 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 ./cypher/CYPHER.md | |
git status | |
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | |
git status | |
git rebase --strategy-option=theirs origin/main --verbose | |
git status | |
git add ./cypher/CYPHER.md | |
git status | |
git commit --amend --no-edit | |
git status | |
git push --verbose |