Skip to content

Commit 7c49019

Browse files
Kris Colemanclaude
andauthored
fix(flagd): move secret check out of job-level if condition (#148)
The `secrets` context is not available in job-level `if:` conditions, which caused every flagd CI run to fail with a workflow file error. Use a separate check-secret job to evaluate secret availability and pass the result via job outputs. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 66af25f commit 7c49019

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/flagd-ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,18 @@ jobs:
5555
fi
5656
echo "Checksum changed: $CHECKSUM_BEFORE -> $CHECKSUM_AFTER"
5757
58+
check-secret:
59+
runs-on: ubuntu-22.04
60+
outputs:
61+
has-token: ${{ steps.check.outputs.has-token }}
62+
steps:
63+
- id: check
64+
run: echo "has-token=${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN != '' }}" >> "$GITHUB_OUTPUT"
65+
5866
helm-install-test:
5967
runs-on: ubuntu-22.04
60-
needs: [lint-and-template]
61-
if: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN != '' }}
68+
needs: [lint-and-template, check-secret]
69+
if: needs.check-secret.outputs.has-token == 'true'
6270
defaults:
6371
run:
6472
working-directory: applications/flagd

0 commit comments

Comments
 (0)