| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 1 | # Simplified Commit Queue |
| 2 | # |
| 3 | # (Force) push to "queue-main-$USER" a potential change, and |
| 4 | # this job will push it main if it passes pre-commit and tests, |
| 5 | # which will run in parallel. The push may fail if the commit |
| 6 | # cannot be pushed cleanly because it needs to be rebased, which |
| 7 | # will happen especially if another developer pushes a change at |
| 8 | # roughly the same time. |
| 9 | |
| 10 | name: Main Branch Commit Queue |
| 11 | on: |
| 12 | push: |
| 13 | branches: |
| 14 | - "queue-main-**" |
| 15 | |
| 16 | permissions: read-all |
| 17 | |
| 18 | jobs: |
| 19 | test: |
| 20 | uses: ./.github/workflows/go_test.yml |
| 21 | permissions: read-all |
| 22 | |
| 23 | push-to-main: |
| 24 | runs-on: ubuntu-latest |
| 25 | needs: [test] |
| 26 | permissions: |
| 27 | contents: write |
| 28 | steps: |
| 29 | - uses: actions/checkout@v4 |
| 30 | with: |
| 31 | fetch-depth: 0 |
| 32 | |
| 33 | - name: Push to main |
| 34 | run: | |
| 35 | git config --global user.name "GitHub Actions Bot" |
| 36 | git config --global user.email "actions@github.com" |
| 37 | git push origin HEAD:main |