-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add valian fireway workflow #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,74 @@ | ||||||||||||||||||||||||||||||||||||||
| name: fireway migrate | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||
| workflow_call: | ||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||
| workload-identity-project-number: | ||||||||||||||||||||||||||||||||||||||
| description: the GCP project number used for Workload Identity Federation | ||||||||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||
| gcp-project-id: | ||||||||||||||||||||||||||||||||||||||
| description: The firebase project environment used for the deployment | ||||||||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||
| gcp-service-account: | ||||||||||||||||||||||||||||||||||||||
| description: the email address of the service account | ||||||||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||
| working-directory: | ||||||||||||||||||||||||||||||||||||||
| description: The working directory of the firebase project | ||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||
| default: functions | ||||||||||||||||||||||||||||||||||||||
| dry-run: | ||||||||||||||||||||||||||||||||||||||
| description: run migrations in dry-run mode | ||||||||||||||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||||||||||||||
| slack-channel-id: | ||||||||||||||||||||||||||||||||||||||
| description: Slack channel id to send alerts to | ||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||
| fireway: | ||||||||||||||||||||||||||||||||||||||
| name: fireway | ||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||
| group: fireway-migrate-${{ inputs.gcp-project-id }} | ||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||
| - name: setup pnpm | ||||||||||||||||||||||||||||||||||||||
| uses: valian-ca/github-workflows/.github/actions/setup-pnpm@main | ||||||||||||||||||||||||||||||||||||||
| - uses: valian-ca/github-workflows/.github/actions/gcp-github-auth@main | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| workload-identity-project-number: ${{ inputs.workload-identity-project-number }} | ||||||||||||||||||||||||||||||||||||||
| gcp-service-account: ${{ inputs.gcp-service-account }} | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - uses: google-github-actions/setup-gcloud@v3 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| project_id: ${{ inputs.gcp-project-id }} | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+43
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Latest stable release for actions/checkout v6 is v6.0.1 (released Dec 2, 2025). [1] Sources: 🌐 Web query:
💡 Result: The action's current stable major release is v3 (latest patch v3.0.1). Pin like:
Docs (inputs, default version behavior, version constraints, Workload Identity requirements): README. [1][2][3] Sources:
🌐 Web query:
💡 Result: Short answer
When tags may be acceptable
Practical best practices
References Pin GitHub Actions to commit SHAs to harden supply-chain security. Using mutable references like For internal actions in Consider automating SHA pin updates using Dependabot or Renovate to keep actions current while maintaining security. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: configure firebase environment | ||||||||||||||||||||||||||||||||||||||
| run: npx firebase use ${{ inputs.gcp-project-id }} | ||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ inputs.working-directory }} | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: run migrations ${{ inputs.dry-run && 'in dry run mode' || '' }} | ||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||
| GCLOUD_PROJECT: ${{ inputs.gcp-project-id }} | ||||||||||||||||||||||||||||||||||||||
| run: npx @valian/fireway migrate ${{ inputs.dry-run && '--dryRun' || '' }} | ||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ inputs.working-directory }} | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: notify Slack of failure | ||||||||||||||||||||||||||||||||||||||
| id: slack | ||||||||||||||||||||||||||||||||||||||
| if: ${{ !success() && inputs.slack-channel-id != '' }} | ||||||||||||||||||||||||||||||||||||||
| uses: valian-ca/github-workflows/.github/actions/slack-alert@main | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| message: fireway migrate ${{ inputs.gcp-project-id }} error | ||||||||||||||||||||||||||||||||||||||
| mrkdwn: | | ||||||||||||||||||||||||||||||||||||||
| :warning: fireway migrate *${{ inputs.gcp-project-id }}* (`${{ job.status }}`) | ||||||||||||||||||||||||||||||||||||||
| token: ${{ secrets.SLACK_BOT_TOKEN }} | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+65
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Short summary of semantics and gotchas
Practical rules
Sources If you want, I can produce a few minimal workflow examples that demonstrate each case. 🌐 Web query:
💡 Result: Short answer: No — GitHub Actions does not allow directly referencing secrets in an if: expression. Use a non-secret value (env var, step output) derived from the secret and test that instead. [1][2] Why and alternatives:
References:
Use When a run is cancelled, ✅ Suggested condition- if: ${{ !success() && inputs.slack-channel-id != '' }}
+ if: ${{ failure() && inputs.slack-channel-id != '' }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| channel: ${{ inputs.slack-channel-id }} | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expose
SLACK_BOT_TOKENinworkflow_callsecrets.The Slack step (Line 73) reads
secrets.SLACK_BOT_TOKEN, but reusable workflows must explicitly declare secrets; otherwise the token is unavailable and the action will fail or no-op.✅ Proposed fix
on: workflow_call: inputs: workload-identity-project-number: description: the GCP project number used for Workload Identity Federation required: true type: string @@ slack-channel-id: description: Slack channel id to send alerts to type: string required: false + secrets: + SLACK_BOT_TOKEN: + required: false📝 Committable suggestion
🤖 Prompt for AI Agents