| # Simplified Commit Queue |
| # |
| # (Force) push to "queue-main-$USER" a potential change, and |
| # this job will push it main if it passes pre-commit and tests, |
| # which will run in parallel. The push may fail if the commit |
| # cannot be pushed cleanly because it needs to be rebased, which |
| # will happen especially if another developer pushes a change at |
| # roughly the same time. |
| |
| name: Main Branch Commit Queue |
| on: |
| push: |
| branches: |
| - "queue-main-*" |
| |
| permissions: read-all |
| |
| jobs: |
| formatting: |
| uses: ./.github/workflows/formatting.yml |
| permissions: read-all |
| with: |
| auto_fix: true |
| |
| go-test: |
| needs: [formatting] |
| uses: ./.github/workflows/go_test.yml |
| permissions: read-all |
| |
| ui-test: |
| needs: [formatting] |
| uses: ./.github/workflows/webui_test.yml |
| permissions: read-all |
| |
| push-to-main: |
| runs-on: ubuntu-latest |
| needs: [go-test, ui-test] |
| permissions: |
| contents: write |
| steps: |
| - uses: actions/checkout@v4 |
| with: |
| fetch-depth: 0 |
| |
| - name: Push to main |
| run: | |
| git config --global user.name "GitHub Actions Bot" |
| git config --global user.email "actions@github.com" |
| git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/boldsoftware/sketch.git HEAD:main |
| env: |
| GITHUB_TOKEN: ${{ github.token }} |