fix: add permissions for auto-merge job to allow write access to pull… #55
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - 'v*.*.*' | |
| pull_request: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| jobs: | |
| cache: | |
| uses: milsman2/python-app-template/.github/workflows/cache-uv-build.yaml@main | |
| lint: | |
| uses: milsman2/python-app-template/.github/workflows/ruff.yaml@main | |
| needs: cache | |
| test: | |
| needs: [lint, cache] | |
| uses: milsman2/python-app-template/.github/workflows/pytest.yaml@main | |
| docker-build-and-image-scan: | |
| if: github.event_name == 'push' | |
| needs: test | |
| uses: milsman2/python-app-template/.github/workflows/docker-build-and-scan.yaml@main | |
| with: | |
| DOCKER_PATH_CONTEXT: . | |
| DOCKER_BUILD_DOCKERFILE: ./Dockerfile | |
| DOCKER_TAGS: ${{ github.repository }}:${{ github.sha }} | |
| DOCKER_LOAD_BOOL: false | |
| DOCKER_PUSH_BOOL: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} | |
| secrets: inherit | |
| release: | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| needs: [test, docker-build-and-image-scan] | |
| uses: ./.github/workflows/release.yaml | |
| permissions: | |
| contents: write | |
| secrets: inherit | |
| trigger-auto-merge: | |
| needs: release | |
| if: needs.release.result == 'success' | |
| uses: ./.github/workflows/auto-merge-on-release.yml | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| with: | |
| head_branch: ${{ github.ref_name }} | |
| secrets: inherit |