Skip to content

Commit 8213f49

Browse files
committed
ci(bot): sync env-flag phantom-run fix from main @ 9dd05d3
Content snapshot (not cherry-pick): ACCOUNT_TOKEN_SET job-env derivation replacing secrets.* in step ifs (push-path parse rejection, actions/runner#4001 class) + concurrency run_id fallbacks. Identical trees to main for these files; merges stay no-ops.
1 parent 465213a commit 8213f49

3 files changed

Lines changed: 32 additions & 5 deletions

File tree

.github/workflows/bot-reply.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
# superseded mention's content is still in the thread history and the next
2525
# run on that thread sees it.
2626
concurrency:
27-
group: bot-reply-${{ inputs.threadNumber }}
27+
group: bot-reply-${{ inputs.threadNumber || github.run_id }}
2828
cancel-in-progress: false
2929

3030
jobs:
@@ -52,6 +52,15 @@ jobs:
5252
# dedicated context block (same machinery as PR Review). Default 1.
5353
PREVIOUS_BOT_REVIEWS_COUNT: ${{ vars.PREVIOUS_BOT_REVIEWS_COUNT || '1' }}
5454

55+
# secrets.* is not evaluable in step-level if: conditionals - the
56+
# push-path validation of dispatch-only workflows (actions/runner#4001
57+
# phantom runs) rejects the file with "Unrecognized named-value:
58+
# (secrets)". Deriving the boolean here (job env, where secrets IS
59+
# valid) and branching on env.X in step ifs is the sanctioned pattern.
60+
# NOTE: a later step writing ACCOUNT_TOKEN_SET to $GITHUB_ENV would
61+
# override this - do not do that.
62+
ACCOUNT_TOKEN_SET: ${{ secrets.ACCOUNT_GH_TOKEN != '' }}
63+
5564
steps:
5665
# Sparse default-branch checkout for the SHARED routing script, so the
5766
# re-validation below runs the exact same decision logic as the router
@@ -157,7 +166,7 @@ jobs:
157166
# validate gate passed (mention confirmed in actual content). The
158167
# regular react step below is the app-mode fallback.
159168
id: fast_eyes
160-
if: steps.validate.outputs.should_proceed == 'true' && inputs.commentId != '' && secrets.ACCOUNT_GH_TOKEN != ''
169+
if: steps.validate.outputs.should_proceed == 'true' && inputs.commentId != '' && env.ACCOUNT_TOKEN_SET == 'true'
161170
continue-on-error: true
162171
env:
163172
GH_TOKEN: ${{ secrets.ACCOUNT_GH_TOKEN }}

.github/workflows/compliance-check.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ name: Compliance Check
3232

3333
# Prevent concurrent runs for the same PR
3434
concurrency:
35-
group: ${{ github.workflow }}-${{ inputs.pr_number }}
35+
group: ${{ github.workflow }}-${{ inputs.pr_number || github.run_id }}
3636
cancel-in-progress: false
3737

3838
on:
@@ -146,13 +146,22 @@ jobs:
146146
}
147147
]
148148
149+
# secrets.* is not evaluable in step-level if: conditionals - the
150+
# push-path validation of dispatch-only workflows (actions/runner#4001
151+
# phantom runs) rejects the file with "Unrecognized named-value:
152+
# (secrets)". Deriving the boolean here (job env, where secrets IS
153+
# valid) and branching on env.X in step ifs is the sanctioned pattern.
154+
# NOTE: a later step writing ACCOUNT_TOKEN_SET to $GITHUB_ENV would
155+
# override this - do not do that.
156+
ACCOUNT_TOKEN_SET: ${{ secrets.ACCOUNT_GH_TOKEN != '' }}
157+
149158
steps:
150159
# ========================================================================
151160
# FAST EYES (account mode, routed comments only) - see pr-review.yml
152161
# ========================================================================
153162
- name: Fast eyes on trigger (account mode)
154163
id: fast_eyes
155-
if: github.event_name == 'workflow_dispatch' && inputs.commentId != '' && secrets.ACCOUNT_GH_TOKEN != ''
164+
if: github.event_name == 'workflow_dispatch' && inputs.commentId != '' && env.ACCOUNT_TOKEN_SET == 'true'
156165
continue-on-error: true
157166
env:
158167
GH_TOKEN: ${{ secrets.ACCOUNT_GH_TOKEN }}

.github/workflows/pr-review.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ jobs:
7474
REVIEW_THREAD_FETCH_LIMIT: '40'
7575
THREAD_COMMENT_FETCH_LIMIT: '10'
7676

77+
# secrets.* is not evaluable in step-level if: conditionals - the
78+
# push-path validation of dispatch-only workflows (actions/runner#4001
79+
# phantom runs) rejects the file with "Unrecognized named-value:
80+
# (secrets)". Deriving the boolean here (job env, where secrets IS
81+
# valid) and branching on env.X in step ifs is the sanctioned pattern.
82+
# NOTE: a later step writing ACCOUNT_TOKEN_SET to $GITHUB_ENV would
83+
# override this - do not do that.
84+
ACCOUNT_TOKEN_SET: ${{ secrets.ACCOUNT_GH_TOKEN != '' }}
85+
7786
steps:
7887
# ========================================================================
7988
# FAST EYES (account mode, routed comments only)
@@ -86,7 +95,7 @@ jobs:
8695
# Failure never blocks the run (cosmetic signal, continue-on-error).
8796
- name: Fast eyes on trigger (account mode)
8897
id: fast_eyes
89-
if: github.event_name == 'workflow_dispatch' && inputs.commentId != '' && secrets.ACCOUNT_GH_TOKEN != ''
98+
if: github.event_name == 'workflow_dispatch' && inputs.commentId != '' && env.ACCOUNT_TOKEN_SET == 'true'
9099
continue-on-error: true
91100
env:
92101
GH_TOKEN: ${{ secrets.ACCOUNT_GH_TOKEN }}

0 commit comments

Comments
 (0)