Generate diagram into an assets branch #14
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: Lint | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| jobs: | |
| build: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: npm install | |
| run: npm install | |
| - name: Run the linter | |
| run: ./lint | |
| - name: Create the diagram | |
| run: ./diagram > diagram.md | |
| - name: Save the diagram | |
| run: | | |
| git add diagram.md | |
| git status | |
| git remote -v | |
| new_branch="${{ github.ref_name }}-diagram" | |
| git branch -D "${new_branch}" || : | |
| git checkout -b "${new_branch}" | |
| git config user.name "${{ github.workflow }}" | |
| git config user.email "github-actions@example.com" | |
| git commit -m "Diagram saved by lint.yml workflow" | |
| git push --set-upstream "$( git remote )" "${new_branch}" |