Added default WF permission to read-only #37
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: mkdocs | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/mkdocs.yml' | |
| - 'docs/**/*' | |
| push: | |
| branches: | |
| main | |
| paths: | |
| - '.github/workflows/mkdocs.yml' | |
| - 'docs/**/*' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Declare default permissions as read only | |
| permissions: read-all | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout vscode-cmsis-debugger | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| - name: Install MkDocs | |
| run: | | |
| pip install mkdocs | |
| - name: Build Documentation | |
| run: mkdocs build | |
| - name: Archive Documentation | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: docs | |
| path: site/ | |
| publish: | |
| if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: write # for Git to git push | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout vscode-cmsis-debugger | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: 'gh-pages' | |
| - name: Purge old content | |
| run: rm -rf * | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: docs | |
| - name: Commit new content | |
| run: | | |
| git config user.name github-actions | |
| git config user.email [email protected] | |
| git add . | |
| git commit -m "Update documentation" | |
| git push |