blob: 8da0dc28f23c088d7136b9a3faf53a0f6fef840b [file] [log] [blame]
Josh Bleecher Snyderefda3962025-04-30 13:09:42 -07001# This is a copy of queue-main.yml, but with a different branch pattern.
Josh Bleecher Snyder008f9582025-06-04 16:26:15 -07002# It does not push the result anywhere or notify Discord; it logs instead.
Josh Bleecher Snyderefda3962025-04-30 13:09:42 -07003# It is meant for people changing how the commit queue works:
4# You can hack on the workflows, push to queue-dev-$USER, and iterate.
5# Please keep this file in sync with queue-main.yml.
6
7name: Dev Commit Queue
8on:
9 push:
10 branches:
11 - "queue-dev-*"
12
13permissions: read-all
14
15jobs:
16 formatting:
17 uses: ./.github/workflows/formatting.yml
18 permissions:
19 contents: write
20 with:
21 auto_fix: true
22
23 go-test:
24 needs: [formatting]
25 uses: ./.github/workflows/go_test.yml
26 permissions: read-all
Josh Bleecher Snyder936ba622025-04-30 20:53:21 +000027 with:
28 ref: ${{ needs.formatting.outputs.commit_sha }}
Josh Bleecher Snyderefda3962025-04-30 13:09:42 -070029
30 ui-test:
31 needs: [formatting]
32 uses: ./.github/workflows/webui_test.yml
33 permissions: read-all
Josh Bleecher Snyder936ba622025-04-30 20:53:21 +000034 with:
35 ref: ${{ needs.formatting.outputs.commit_sha }}
Josh Bleecher Snyderefda3962025-04-30 13:09:42 -070036
37 push-to-main:
38 runs-on: ubuntu-latest
39 needs: [go-test, ui-test, formatting]
40 permissions:
41 contents: write
42 steps:
43 - uses: actions/checkout@v4
44 with:
45 fetch-depth: 0
46
47 - name: Push to main
Josh Bleecher Snyder6e463602025-05-28 18:10:59 +000048 id: push
Josh Bleecher Snyderefda3962025-04-30 13:09:42 -070049 run: |
50 COMMIT_TO_PUSH="HEAD"
51 if [[ "${{ needs.formatting.outputs.commit_sha }}" != "" ]]; then
52 echo "Using formatted commit: ${{ needs.formatting.outputs.commit_sha }}"
53 COMMIT_TO_PUSH="${{ needs.formatting.outputs.commit_sha }}"
54 fi
55
Josh Bleecher Snyder6e463602025-05-28 18:10:59 +000056 # Get the actual commit SHA that we're pushing
57 COMMIT_SHA=$(git rev-parse "${COMMIT_TO_PUSH}")
58 echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT
59
Philip Zeyligerfb56a5c2025-07-16 22:38:38 +000060 # Ensure we have the latest main branch reference
61 git fetch origin main
62
Josh Bleecher Snyder837699b2025-05-28 18:58:17 +000063 # Get the list of commits that would be pushed (in chronological order)
Philip Zeyligerfb56a5c2025-07-16 22:38:38 +000064 # Use FETCH_HEAD as the base to avoid rewriting local main reference
65 COMMITS_TO_NOTIFY=$(git log FETCH_HEAD.."${COMMIT_TO_PUSH}" --reverse --format="%H" | tr '\n' ' ')
Josh Bleecher Snyder837699b2025-05-28 18:58:17 +000066 echo "commits_to_notify=${COMMITS_TO_NOTIFY}" >> $GITHUB_OUTPUT
67 echo "Commits that would be pushed and notified: ${COMMITS_TO_NOTIFY}"
68
Josh Bleecher Snyderefda3962025-04-30 13:09:42 -070069 echo "Would push to main: ${COMMIT_TO_PUSH}"
70 env:
71 GITHUB_TOKEN: ${{ github.token }}