update: eliminate circular dependendency #1
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: preview | ||
|
Check failure on line 1 in .github/workflows/preview.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| publish: | ||
| description: 'The directory to publish to pkg.pr.new' | ||
| default: "./packages/**" | ||
| required: false | ||
| type: string | ||
| template: | ||
| description: 'The directory of templates to publish to StackBlitz' | ||
| default: "./examples/**" | ||
| required: false | ||
| type: string | ||
| secrets: | ||
| BOT_APP_ID: | ||
| description: 'The GitHub App ID for authenticating with the GitHub API' | ||
| required: false | ||
| BOT_PRIVATE_KEY: | ||
| description: 'The GitHub App Private Key for authenticating with the GitHub API' | ||
| required: false | ||
| jobs: | ||
| preview: | ||
| if: github.repository_owner == 'bombshell-dev' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Only generate token if secrets are provided (external calls) | ||
| - name: Generate a token | ||
| if: secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != '' | ||
| id: bot-token | ||
| uses: actions/create-github-app-token@v1 | ||
| with: | ||
| app-id: ${{ secrets.BOT_APP_ID }} | ||
| private-key: ${{ secrets.BOT_PRIVATE_KEY }} | ||
| # Checkout with conditional token usage | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.head_ref }} | ||
| token: ${{ secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != '' && steps.bot-token.outputs.token || '' }} | ||
| - name: Setup PNPM | ||
| uses: pnpm/action-setup@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| registry-url: https://registry.npmjs.org/ | ||
| cache: "pnpm" | ||
| - name: Install dependencies | ||
| run: pnpm install | ||
| - name: Build packages | ||
| run: pnpm run build | ||
| - name: Publish Preview | ||
| run: pnpx pkg-pr-new publish '${{inputs.publish}}' --template '${{inputs.template}}' | ||