UI quickstart improvements #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Extract Snippets | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - "samples/**" | |
| - "scripts/**" | |
| - "placeholder-map.yaml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| working-directory: scripts | |
| run: yarn install --immutable | |
| - name: Aggregate manifests | |
| working-directory: scripts | |
| run: yarn aggregate | |
| - name: Extract snippets | |
| working-directory: scripts | |
| run: yarn extract | |
| - name: Validate structure | |
| working-directory: scripts | |
| run: yarn validate | |
| - name: Verify no drift (PR only) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| git diff --exit-code snippets.json snippet-manifest.yaml || \ | |
| (echo "::error::Extracted artifacts are out of date. Run 'cd scripts && yarn all' and commit the results." && exit 1) | |
| commit: | |
| needs: validate | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| working-directory: scripts | |
| run: yarn install --immutable | |
| - name: Aggregate manifests | |
| working-directory: scripts | |
| run: yarn aggregate | |
| - name: Extract snippets | |
| working-directory: scripts | |
| run: yarn extract | |
| - name: Check for changes | |
| id: diff | |
| run: | | |
| git diff --quiet snippets.json snippet-manifest.yaml || echo "changed=true" >> "$GITHUB_OUTPUT" | |
| - name: Commit updated artifacts | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add snippets.json snippet-manifest.yaml | |
| git commit -m "chore: update extracted snippets and manifest" | |
| git push | |
| # - name: Notify ciam-core of snippet changes | |
| # if: steps.diff.outputs.changed == 'true' | |
| # run: | | |
| # gh api repos/SecureAuthCorp/ciam-core/dispatches \ | |
| # -f event_type=quickstart-snippets-updated \ | |
| # -f 'client_payload[sha]=${{ github.sha }}' | |
| # env: | |
| # GH_TOKEN: ${{ secrets.CIAM_CORE_DISPATCH_TOKEN }} |