Skip to content

Commit 4eaf4a6

Browse files
committed
Trigger docker build on branch name rather than PR label
gh pr create --label fails consistently due to token permission constraints. The sync branch name (sync/upstream-v*) is a more reliable signal than a label and requires no extra API calls. Remove label logic from the sync workflow entirely.
1 parent 939fc0d commit 4eaf4a6

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

.github/workflows/teal-docker-publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Publish Docker Image
33
# Triggers:
44
# 1. Push to master whose commit message starts with "chore: sync upstream v..."
55
# (i.e. a clean auto-merge from teal-sync-upstream-release.yml)
6-
# 2. A pull_request with the "upstream-sync" label is merged to master
6+
# 2. A pull_request from a sync/upstream-v* branch is merged to master
77
# (i.e. a conflict resolution PR from teal-sync-upstream-release.yml)
88
# 3. Manual dispatch — useful for rebuilding any version on demand.
99

@@ -59,10 +59,9 @@ jobs:
5959
6060
elif [[ "$EVENT" == "pull_request" ]]; then
6161
MERGED="${{ github.event.pull_request.merged }}"
62-
LABELS='${{ toJson(github.event.pull_request.labels.*.name) }}'
6362
BRANCH="${{ github.event.pull_request.head.ref }}"
6463
65-
if [[ "$MERGED" == "true" ]] && echo "$LABELS" | grep -q '"upstream-sync"'; then
64+
if [[ "$MERGED" == "true" ]] && [[ "$BRANCH" =~ ^sync/upstream-v ]]; then
6665
VERSION=$(echo "$BRANCH" | grep -oP 'v[0-9]+\.[0-9x.]+' || true)
6766
if [[ -z "$VERSION" ]]; then
6867
VERSION=$(gh api repos/metabase/metabase/releases/latest --jq '.tag_name')

.github/workflows/teal-sync-upstream-release.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,11 @@ jobs:
142142
echo "> \`frontend/src/metabase/ui/colors/constants/themes/dark.ts\`" >> "$BODY_FILE"
143143
echo "> \`src/metabase/appearance/settings.clj\`" >> "$BODY_FILE"
144144
145-
gh label create "upstream-sync" \
146-
--color "0075ca" \
147-
--description "Automatic upstream release sync" \
148-
--repo "$GITHUB_REPOSITORY" 2>/dev/null || true
149-
150145
gh pr create \
151146
--title "chore: sync upstream $TAG (merge conflicts)" \
152147
--body-file "$BODY_FILE" \
153148
--base master \
154-
--head "$BRANCH" \
155-
--label "upstream-sync"
149+
--head "$BRANCH"
156150
157151
- name: Summary
158152
if: always()

0 commit comments

Comments
 (0)