Skip to content

fix: Uses GITHUB_TOKEN to authenticate the GH action to stop Ratelimits#3471

Merged
perkinsjr merged 4 commits intomainfrom
ci-fix-ratelimits
Jul 7, 2025
Merged

fix: Uses GITHUB_TOKEN to authenticate the GH action to stop Ratelimits#3471
perkinsjr merged 4 commits intomainfrom
ci-fix-ratelimits

Conversation

@perkinsjr
Copy link
Member

@perkinsjr perkinsjr commented Jul 7, 2025

What does this PR do?

  1. Prevents Rate Limiting: The GITHUB_TOKEN provides authenticated access to GitHub APIs, significantly increasing rate limits. It's deleted everytime the job is successful or the job hits 24h and a new one is issued.
  2. Improves Reliability: Go module downloads, npm/pnpm installations, and GitHub Actions marketplace downloads will be more reliable
  3. Faster Builds: Authenticated requests are prioritized and have higher rate limits
  4. Better Error Handling: You'll get more descriptive error messages instead of generic rate limit errors

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

RIP some PR's and see what happens. I am assuming that GITHUB_TOKEN's work like PATs

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

Summary by CodeRabbit

  • Chores
    • Updated multiple GitHub Actions workflows to pass a GitHub authentication token to installation steps, improving authenticated access during setup.
    • Added a new optional input for GitHub authentication to the custom install action.
    • Adjusted workflow configurations, including permissions and secret declarations, and updated application deployment targets where applicable.
    • Minor formatting and naming improvements in workflow files.

@vercel
Copy link

vercel bot commented Jul 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
dashboard ⬜️ Ignored (Inspect) Visit Preview Jul 7, 2025 8:50pm
engineering ⬜️ Ignored (Inspect) Visit Preview Jul 7, 2025 8:50pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 7, 2025

📝 Walkthrough

Walkthrough

A new optional github_token input was added to the .github/actions/install composite action, allowing workflows to inject the GitHub Actions token for authenticated operations. Multiple GitHub Actions workflow files were updated to pass this token to the install action and, in some cases, to set it as an environment variable for relevant steps. No changes to control flow or logic were made.

Changes

File(s) Change Summary
.github/actions/install/action.yaml Added optional github_token input; passes token as GITHUB_TOKEN env var to Go/Node steps.
.github/workflows/autofix.ci.yaml
.github/workflows/build.yaml
.github/workflows/changesets.yaml
.github/workflows/check_quotas.yml
.github/workflows/deploy_trigger.yaml
.github/workflows/job_clickhouse_migration_preview.yaml
.github/workflows/job_clickhouse_migration_production.yaml
.github/workflows/job_deploy_api_canary.yaml
.github/workflows/job_deploy_api_enterprise.yaml
.github/workflows/job_deploy_api_production.yaml
.github/workflows/job_deploy_api_staging.yaml
.github/workflows/job_deploy_logdrain_production.yaml
.github/workflows/job_test_agent_integration.yaml
.github/workflows/job_test_agent_local.yaml
.github/workflows/job_test_api_canary.yaml
.github/workflows/job_test_api_local.yaml
.github/workflows/job_test_api_staging.yaml
.github/workflows/job_test_go_api_local.yaml
.github/workflows/job_test_unit.yaml
.github/workflows/release.yaml
.github/workflows/test_agent_local.yaml
Updated install steps to pass github_token: ${{ secrets.GITHUB_TOKEN }} to the custom install action; in some cases, set GITHUB_TOKEN env var for setup steps; minor formatting/whitespace adjustments.
.github/workflows/job_deploy_workflows.yaml Renamed workflow and updated build/deploy steps to target "workflows" app instead of "logdrain"; added github_token input to install step.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow
    participant InstallAction
    participant GoSteps
    participant NodeSteps

    Workflow->>InstallAction: Run with github_token input
    InstallAction->>GoSteps: Set GITHUB_TOKEN env (if github_token provided)
    InstallAction->>NodeSteps: Set GITHUB_TOKEN and NPM_TOKEN env (if github_token provided)
    GoSteps-->>InstallAction: Perform authenticated Go operations
    NodeSteps-->>InstallAction: Perform authenticated Node operations
    InstallAction-->>Workflow: Complete installation
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2025

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🔭 Outside diff range comments (2)
.github/workflows/job_test_go_api_local.yaml (1)

15-22: Tighten default permissions

This job now needs the token only for dependency resolution.
Add an explicit, least-privilege permissions: block (e.g. contents: read, packages: read) to avoid the default write scopes that come with ${{ secrets.GITHUB_TOKEN }}.

jobs:
  tests:
    permissions:
      contents: read
      packages: read
.github/workflows/deploy_trigger.yaml (1)

9-12: Duplicate actions/checkout@v4 step – remove the second invocation
The workflow checks the repo out twice in succession. Unless you need a fresh checkout after an earlier cache-clearing step (none exists), the extra call is redundant and adds ~7-10 s to every run.

-      - uses: actions/checkout@v4
-
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v4
♻️ Duplicate comments (6)
.github/workflows/job_test_unit.yaml (1)

26-32: Same permission hardening recommendation as other test jobs

Consider adding a minimal permissions: block for this job; it currently inherits the expansive defaults.

.github/workflows/job_test_api_staging.yaml (1)

37-42: Same permission hardening recommendation as other test jobs

Lock token scopes to contents: read and packages: read to prevent privilege creep.

.github/workflows/job_test_agent_local.yaml (1)

13-16: Same token-leak concern as in test_agent_local.yaml

Reuse the outcome of the audit requested above; no further action if the composite is already safe.

.github/workflows/job_test_api_local.yaml (1)

19-25: Token-leak audit applies here as well

The comment made for test_agent_local.yaml equally applies to this workflow.

.github/workflows/job_clickhouse_migration_production.yaml (1)

18-26: Re-check composite action for secret leakage

Same audit request as earlier: ensure .github/actions/install never prints the token value.

.github/workflows/job_test_api_canary.yaml (1)

32-36: Token secrecy audit

Audit the composite action for accidental token echoing, as noted in prior comments.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1023c59 and 03ab229.

📒 Files selected for processing (23)
  • .github/actions/install/action.yaml (5 hunks)
  • .github/workflows/autofix.ci.yaml (1 hunks)
  • .github/workflows/build.yaml (2 hunks)
  • .github/workflows/changesets.yaml (2 hunks)
  • .github/workflows/check_quotas.yml (1 hunks)
  • .github/workflows/deploy_trigger.yaml (1 hunks)
  • .github/workflows/job_clickhouse_migration_preview.yaml (1 hunks)
  • .github/workflows/job_clickhouse_migration_production.yaml (1 hunks)
  • .github/workflows/job_deploy_api_canary.yaml (3 hunks)
  • .github/workflows/job_deploy_api_enterprise.yaml (2 hunks)
  • .github/workflows/job_deploy_api_production.yaml (1 hunks)
  • .github/workflows/job_deploy_api_staging.yaml (3 hunks)
  • .github/workflows/job_deploy_logdrain_production.yaml (1 hunks)
  • .github/workflows/job_deploy_workflows.yaml (2 hunks)
  • .github/workflows/job_test_agent_integration.yaml (1 hunks)
  • .github/workflows/job_test_agent_local.yaml (1 hunks)
  • .github/workflows/job_test_api_canary.yaml (1 hunks)
  • .github/workflows/job_test_api_local.yaml (1 hunks)
  • .github/workflows/job_test_api_staging.yaml (1 hunks)
  • .github/workflows/job_test_go_api_local.yaml (1 hunks)
  • .github/workflows/job_test_unit.yaml (1 hunks)
  • .github/workflows/release.yaml (1 hunks)
  • .github/workflows/test_agent_local.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
.github/workflows/job_clickhouse_migration_production.yaml (2)
Learnt from: chronark
PR: unkeyed/unkey#3161
File: go/pkg/clickhouse/schema/databases/001_verifications/002_raw_key_verifications_v1.sql:31-33
Timestamp: 2025-04-22T14:40:51.459Z
Learning: The ClickHouse table schemas in the codebase mirror the production environment and cannot be modified directly in PRs without careful migration planning.
Learnt from: chronark
PR: unkeyed/unkey#3161
File: go/pkg/clickhouse/schema/databases/002_ratelimits/006_ratelimits_per_day_v1.sql:1-13
Timestamp: 2025-04-22T14:43:11.724Z
Learning: In the unkey project, the SQL files in clickhouse/schema/databases represent the current production schema and shouldn't be modified directly in PRs. Schema changes require dedicated migration scripts.
.github/workflows/job_deploy_api_staging.yaml (1)
Learnt from: Devansh-Baghel
PR: unkeyed/unkey#2452
File: oss.gg/7_create_a_template.md:42-42
Timestamp: 2024-10-15T19:57:16.520Z
Learning: In projects using Cloudflare Workers, the `wrangler.toml` file in the project root is the configuration file.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (22)
.github/actions/install/action.yaml (1)

91-94: Verify that re-using the GitHub token as NPM_TOKEN actually works

NPM_TOKEN usually expects an npm-registry auth token, not a GitHub Actions token.
If your packages are hosted on GH Packages this is fine; otherwise the install step will start 401-ing and, worse, the GitHub token could get copied into .npmrc.

Please double-check the registry and adjust if required.

.github/workflows/release.yaml (1)

23-28: Looks good – release workflow correctly forwards the token
No additional issues spotted with the new input wiring in this file.

.github/workflows/deploy_trigger.yaml (2)

14-15: ✅ Token wired through correctly
Passing ${{ secrets.GITHUB_TOKEN }} to the install action is the right move now that the composite action supports authenticated installs.


21-22: Verify working-directory path
apps/billing looks sensible, but because the step is executed from the repo root after a mono-repo install it’s easy to fat-finger. Just double-check the folder exists (case-sensitive) to avoid silent no-op failures.

.github/workflows/job_deploy_api_production.yaml (1)

19-19: ✅ Authenticated install enabled
github_token passed – keeps pnpm / go module downloads behind the token and avoids rate-limit pain.

.github/workflows/job_deploy_logdrain_production.yaml (1)

19-19: ✅ Token forwarding looks good
Nothing else to flag.

.github/workflows/job_test_agent_integration.yaml (1)

19-19: ✅ Install step now authenticated
Should cut down on flaky go proxy 403s in long integration runs.

.github/workflows/check_quotas.yml (1)

26-26: ✅ Cron job will now install with proper auth
Good addition; scheduled workflows previously had a higher chance of hitting anonymous rate limits.

.github/workflows/test_agent_local.yaml (1)

13-16: Confirm the install action keeps the token secret

The new github_token input is useful for authenticated installs, but please double-check that .github/actions/install does not write inputs.github_token (or env.GITHUB_TOKEN) to stdout/stderr, as that would leak the secret.
Consider adding shell: bash --noprofile --norc -euo pipefail and set -x avoidance inside the composite to be safe.

.github/workflows/changesets.yaml (1)

26-26: Token forwarding looks correct

Passing the repository token to the custom install action is consistent with the new input signature.
No further concerns here.

.github/workflows/build.yaml (2)

5-7: Adequate permission scope

contents: read is sufficient for a pure build workflow that does not push artifacts back to GitHub.
👍


22-22: OK – token propagated to install step

Matches the composite action’s new github_token input. Nothing else to flag.

.github/workflows/job_deploy_api_enterprise.yaml (2)

4-6: Whitespace-only tweak – no action needed


28-28: Verify secret availability when invoked via workflow_call

secrets.GITHUB_TOKEN is automatically provided, but its default permission set is read.
If the install action (or downstream tools like pnpm) require write access (e.g., to hit private registries with npm publish), you must explicitly elevate the permission in the caller workflow.

Confirm the caller grants at least:

permissions:
  contents: read   # or write, if needed by install action
.github/workflows/autofix.ci.yaml (1)

26-26: Token correctly forwarded to install action

Looks good.

.github/workflows/job_deploy_api_staging.yaml (3)

4-6: No functional change – formatting only


19-19: Token passthrough OK

Matches the composite action interface.


28-28: 👍 Secret forwarded to deployment step

Ensures the deploy command can authenticate with Cloudflare.

.github/workflows/job_deploy_api_canary.yaml (1)

19-20: Token now forwarded to install action – LGTM

Passing the GitHub token enables authenticated pnpm, go, or npm installs inside the composite action. No further comments.

.github/workflows/job_clickhouse_migration_preview.yaml (1)

20-20: Authenticated install step looks correct

Forwarding github_token keeps this job consistent with the other workflows. 👍

.github/workflows/job_deploy_workflows.yaml (2)

22-22: Verify build filter path

./apps/workflows replaces the previous ./apps/logdrain. Ensure:

  1. The workflows app exists in the monorepo.
  2. Its package.json has the correct build script invoked by turbo.

If either is missing, this step will noop or fail the job.


26-28: Working-directory update mirrors build change – LGTM

Directory switch to apps/workflows aligns with the new build target.

@changeset-bot
Copy link

changeset-bot bot commented Jul 7, 2025

⚠️ No Changeset found

Latest commit: cd89d67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03ab229 and 90f96b8.

📒 Files selected for processing (3)
  • .github/workflows/autofix.ci.yaml (1 hunks)
  • .github/workflows/changesets.yaml (2 hunks)
  • .github/workflows/job_clickhouse_migration_preview.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions. No additional configuration is needed for this automatic masking behavior.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: The `sensitive` property is not supported for GitHub Actions composite action inputs - it's only available for reusable workflow inputs. Composite action inputs don't have a `sensitive` attribute in their schema.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: The `sensitive` property is not supported for GitHub Actions composite action inputs - it's only available for reusable workflow inputs using `workflow_call`. Attempting to use `sensitive: true` in composite action inputs results in a schema validation error "Property sensitive is not allowed. (yaml-schema: GitHub Action 513)".
.github/workflows/changesets.yaml (2)
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions. No additional configuration is needed for this automatic masking behavior.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions.
.github/workflows/autofix.ci.yaml (4)
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions. No additional configuration is needed for this automatic masking behavior.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: The `sensitive` property is not supported for GitHub Actions composite action inputs - it's only available for reusable workflow inputs using `workflow_call`. Attempting to use `sensitive: true` in composite action inputs results in a schema validation error "Property sensitive is not allowed. (yaml-schema: GitHub Action 513)".
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: The `sensitive` property is not supported for GitHub Actions composite action inputs - it's only available for reusable workflow inputs. Composite action inputs don't have a `sensitive` attribute in their schema.
.github/workflows/job_clickhouse_migration_preview.yaml (2)
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions. No additional configuration is needed for this automatic masking behavior.
Learnt from: perkinsjr
PR: unkeyed/unkey#3471
File: .github/actions/install/action.yaml:9-12
Timestamp: 2025-07-07T19:45:10.498Z
Learning: GitHub Actions automatically masks tokens in logs when they come from secrets (like `${{ secrets.GITHUB_TOKEN }}`) or match recognized token patterns, regardless of any explicit sensitive marking in composite actions.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Test Packages / Test ./packages/rbac
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/resend
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
.github/workflows/changesets.yaml (2)

11-13: Permissions correctly updated to write – resolves prior blocker
The workflow can now push commits, tags, and open PRs as required by changesets/action.


27-27: Confirm github_token input is recognised by the install action
If .github/actions/install/action.yaml has not been published with a matching inputs.github_token, the workflow will fail schema-validation at runtime.

.github/workflows/autofix.ci.yaml (2)

18-18: Uses token: input for setup-node – perfect
This change fixes the authentication gap flagged in the previous review.


24-24: Same token propagation caveat as above
Double-check the composite install action’s input contract to avoid “unexpected named parameter” errors.

.github/workflows/job_clickhouse_migration_preview.yaml (1)

20-20: Token now passed to install action
Consistent with other workflows – OK as long as the action expects it.

@perkinsjr perkinsjr changed the title fix: AUTHENTICATE ME PLEASE IGNORE fix: Uses GITHUB_TOKEN to authenticate the GH action to stop Ratelimits Jul 7, 2025
Copy link
Collaborator

@chronark chronark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use secrets pls

description: Whether to install Go and dependencies
ts:
description: Whether to install Node.js and dependencies
github_token:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a secret, not an input

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see .github/workflows/job_deploy_workflows.yaml as an example for passing secrets

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly how that works? WYM use a secret.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're passing it in as an input which might not get redacted in logs properly, use a secretinstead like in the workflow above

Copy link
Member Author

It's already redacted? This is passed to the logs as ********

 with:
          ts: true
          github_token: ${{ secrets.GITHUB_TOKEN }}

Copy link
Member Author

Copy link
Collaborator

chronark commented Jul 7, 2025

I don't make the rules
github has a special field for secrets for this, so I think we should use it
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets

Copy link
Member Author

I don't understand. I am using secret and passing it as the input?

this is exactly what I am doing...

IN THIS PR

with:
          ts: true
          github_token: ${{ secrets.GITHUB_TOKEN }}

EXAMPLE

with:
          token: ${{ secrets.access-token }}

Copy link
Member Author

This isn't a secret we are giving to Github... This secret is accessible anywhere in a runner? so you want me to secret a internal secret?

Copy link
Collaborator

chronark commented Jul 7, 2025

Copy link
Collaborator

chronark commented Jul 7, 2025

it should be

inputs:
  go:
    description: Whether to install Go and dependencies
  ts:
    description: Whether to install Node.js and dependencies
secrets:
  github_token:
    description: GitHub token for authentication
    required: false

Copy link
Collaborator

chronark commented Jul 7, 2025

it probably doesn’t make a big difference, but if this ever gets leaked for whatever reason cause we didn’t do it properly according to their docs, while knowing about it, we’re fucked

Copy link
Member Author

Copy link
Member Author

  • name: Checkout
    uses: actions/checkout@v4
    with:
    token: ${{ secrets.GITHUB_TOKEN }} # Common pattern

  • name: Setup Node
    uses: actions/setup-node@v4
    with:
    node-version: 16
    env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Also common

Copy link
Collaborator

chronark commented Jul 7, 2025

we’re talking about 2 different things
I’m talking about the receiving side, you’re talking about the providing side

Copy link
Member Author

perkinsjr commented Jul 7, 2025

No we aren't?

The providing side provides it a secret (e.g any job that is calling it), the receiving side receives it as a redacted...

The one time use token is then destroyed?

This would be the same for a published example like Checkout or autofix CI

Copy link
Collaborator

chronark commented Jul 7, 2025

I gave my feedback, do with that what you want

Copy link
Collaborator

chronark commented Jul 7, 2025

we’re debating about a 1 line change that has no downside

Copy link
Collaborator

chronark commented Jul 7, 2025

I haven’t dug too deep in to their docs

Copy link
Collaborator

chronark commented Jul 7, 2025

if thisi s what they recommend, it should be fine

Copy link
Collaborator

chronark commented Jul 7, 2025

I just see us using a secret and know there’ s an actual secret field, so I suggested it

Copy link
Member Author

It's not a 1 line change. This is a composite action which don't have secrets. They are received via the inputs, which is why on the other side they are passed as a secret to the composite action as a redacting in the logs.

This is also why every single file of ours has a permission in it to make sure the code is trusted and can't be executed. I am happy to let you read up on composite actions etc before we merge.

Copy link
Member Author

I will also happily rewrite our CI to use Reusuable workflows instead, if you want to use secrets directly.

Copy link
Collaborator

chronark commented Jul 7, 2025

oh so there’s a difference between actions and workflows.. TIL
yeet away

@perkinsjr perkinsjr merged commit bfa9580 into main Jul 7, 2025
27 of 30 checks passed
@perkinsjr perkinsjr deleted the ci-fix-ratelimits branch July 7, 2025 20:50
@coderabbitai coderabbitai bot mentioned this pull request Aug 8, 2025
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants