-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: create actions/setup-dependencies/action #1190
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
Conversation
WalkthroughAdds a new GitHub Actions composite action at Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant WF as Workflow
participant ACTION as setup-dependencies (composite)
participant CHECKOUT as actions/checkout
participant SCRIPT as install-sdk-preview.mjs
participant NODE as actions/setup-node
participant YARN as yarn
WF->>ACTION: call ./.github/actions/setup-dependencies (input: authToken)
ACTION->>CHECKOUT: checkout repo (persist-credentials configurable)
ACTION->>SCRIPT: run via github-script (env: PACKAGE_READ_AUTH_TOKEN)
ACTION->>NODE: setup node (node-version: lts/*) + enable yarn cache
ACTION->>YARN: yarn install --frozen-lockfile
ACTION-->>WF: dependencies ready
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (5)
⏰ 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). (1)
🔇 Additional comments (1)
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. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/generateAuxLists.yml (1)
16-17: Consider explicitly passingpersist_credentialsfor consistency.This workflow omits the
persist_credentialsinput, relying on the action's default (false). While this works correctly, other workflows explicitly pass this parameter. For consistency and clarity, consider adding it:- name: Setup dependencies uses: ./.github/actions/setup-dependencies + with: + persist_credentials: false
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/actions/setup-dependencies/action.yml(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/cowFi-tokens.yml(1 hunks).github/workflows/executeAction.yml(1 hunks).github/workflows/generateAuxLists.yml(1 hunks).github/workflows/updatePermitInfo.yml(1 hunks)
🔇 Additional comments (6)
.github/actions/setup-dependencies/action.yml (2)
20-22: Verify YAML script formatting and indentation.Lines 21-22 contain a multi-line JavaScript string with unusual indentation. Ensure this is valid YAML and the script parses correctly at runtime.
For clarity, consider formatting as a single line or using YAML block syntax:
with: - script: const { installSdkPreview } = await import("${{github.workspace}}/src/scripts/install-sdk-preview.mjs"); - installSdkPreview(context, core); + script: | + const { installSdkPreview } = await import("${{github.workspace}}/src/scripts/install-sdk-preview.mjs"); + installSdkPreview(context, core);
1-34: Action consolidates setup steps effectively.The new composite action successfully centralizes dependency setup (checkout, npm config, Node.js, yarn install) into a reusable unit. This eliminates duplication across five workflows and follows the DRY principle well.
.github/workflows/cowFi-tokens.yml (1)
18-21: Migration to composite action is correct.The workflow cleanly delegates dependency setup to the new action, reducing code duplication while maintaining the
persist_credentials: falserequirement for this job..github/workflows/executeAction.yml (1)
27-30: Setup consolidated correctly.The workflow now uses the composite action to handle dependency setup. The removal of
PACKAGE_READ_AUTH_TOKENenvironment variable is correct since it's now managed within the action..github/workflows/ci.yml (1)
17-20: Clean setup consolidation.The CI workflow now delegates all setup tasks to the composite action, reducing boilerplate while maintaining the same security posture with
persist_credentials: false..github/workflows/updatePermitInfo.yml (1)
22-25: Setup step correctly migrated forupdate-permit-infojob.The matrix-based job correctly uses the composite action for dependency setup. The separate
commit-changesjob retains its own standalone checkout (line 52), which is appropriate since it's a dependent job that downloads artifacts.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/actions/setup-dependencies/action.yml(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/cowFi-tokens.yml(1 hunks).github/workflows/executeAction.yml(1 hunks).github/workflows/generateAuxLists.yml(1 hunks).github/workflows/updatePermitInfo.yml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- .github/workflows/cowFi-tokens.yml
- .github/workflows/ci.yml
- .github/workflows/generateAuxLists.yml
🧰 Additional context used
🪛 GitHub Actions: CI
.github/actions/setup-dependencies/action.yml
[error] 13-13: Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.PACKAGE_READ_AUTH_TOKEN
🔇 Additional comments (4)
.github/workflows/updatePermitInfo.yml (1)
27-28: LGTM!The consolidation of dependency setup into a single reusable action simplifies the workflow while maintaining clarity.
.github/actions/setup-dependencies/action.yml (2)
15-19: LGTM!The Node.js setup is properly configured with LTS version and Yarn caching enabled.
21-23: LGTM!The dependency installation with frozen lockfile ensures reproducible builds across workflows.
.github/workflows/executeAction.yml (1)
32-33: LGTM, pending upstream fix.The Setup dependencies consolidation is correctly applied here. However, this workflow will fail due to the critical issue in the composite action (secrets context access). Once that is resolved, this change will work as intended.
|
Please post merge review |
Summary
Refactor to simplify gh actions, creating a reusable workflow for setting up the repo.
Summary by CodeRabbit