Skip to content

Commit c9fb7e5

Browse files
committed
feat: adds flag validation workflows
Adds a workflow to validate feature flag changes against the base branch and a remote manifest. This ensures consistency and correctness of flag configurations. Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
1 parent 1df3646 commit c9fb7e5

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

.github/workflows/pr-check.yaml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- name: Setup Node
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version-file: '.nvmrc'
24-
cache: 'npm'
23+
node-version-file: ".nvmrc"
24+
cache: "npm"
2525

2626
- name: Restore cache
2727
uses: actions/cache@v4
@@ -40,9 +40,38 @@ jobs:
4040
if: always()
4141
uses: ctrf-io/github-test-reporter@v1
4242
with:
43-
report-path: './ctrf/*.json'
43+
report-path: "./ctrf/*.json"
4444
env:
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4646

4747
- name: Build with Next.js
48-
run: npm run build
48+
run: npm run build
49+
50+
validate-flags:
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: read
54+
pull-requests: write
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0 # Required for git branch comparison
60+
61+
- name: Compare against base branch
62+
uses: open-feature/action@v0.0.2
63+
with:
64+
manifest: "flags.json"
65+
# Automatically compares against PR base branch (main)
66+
- name: Check FLAGD_STUDIO_TOKEN secret
67+
run: |
68+
if [ -z "${{ secrets.FLAGD_STUDIO_TOKEN }}" ]; then
69+
echo "WARNING: FLAGD_STUDIO_TOKEN is not set. Remote manifest comparison may fail."
70+
fi
71+
72+
- name: Compare against remote manifest
73+
uses: open-feature/action@v0.0.2
74+
with:
75+
manifest: "flags.json"
76+
against: "https://flagd-studio.onrender.com/api"
77+
auth-token: ${{ secrets.FLAGD_STUDIO_TOKEN }}

0 commit comments

Comments
 (0)