-
Notifications
You must be signed in to change notification settings - Fork 16
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
chore: update GitHub actions version and add .nvmrc, node-version-file #179
base: main
Are you sure you want to change the base?
chore: update GitHub actions version and add .nvmrc, node-version-file #179
Conversation
…ion-file' instead of 'node-version
WalkthroughThis pull request focuses on updating GitHub Actions workflows for a Next.js project. The changes primarily involve upgrading action versions from v3 to v4 in both Changes
Possibly related PRs
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (1)
.github/workflows/deploy.yml (1)
10-10
: String literal style changes are unnecessaryThe changes from double quotes to single quotes (
"main"
→'main'
and"pages"
→'pages'
) are purely stylistic and don't affect functionality.Consider maintaining the original double quotes for consistency with other YAML files in the project.
Also applies to: 23-23
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/ci.yml
(2 hunks).github/workflows/deploy.yml
(5 hunks).nvmrc
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .nvmrc
🔇 Additional comments (5)
.github/workflows/ci.yml (3)
21-21
: Verify .nvmrc file exists and contains valid version
The workflow now references .nvmrc
for Node.js version management, which is a good practice for version consistency.
✅ Verification successful
Node.js version configuration is properly set up
The .nvmrc
file exists and contains version 20, which is a valid and currently supported LTS version of Node.js.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if .nvmrc exists and contains a valid version
if [ -f ".nvmrc" ]; then
echo "Content of .nvmrc:"
cat .nvmrc
else
echo "ERROR: .nvmrc file not found"
exit 1
fi
Length of output: 82
46-49
: Review Next.js export configuration
The comment about next export
deprecation is important. For Next.js 13.3.0+, the export process has changed.
Consider updating the export configuration based on your Next.js version:
- For Next.js >= 13.3.0: Remove
next export
and updatenext.config.js
withoutput: 'export'
- For Next.js < 13.3.0: Keep the current configuration
✅ Verification successful
Let me verify the next.config.js configuration to provide a complete assessment.
Update Next.js export configuration for version 13.0.0
The project uses Next.js 13.0.0, which still supports and requires the next export
command for static exports. The current configuration in the CI workflow is correct and should be maintained.
- Keep the
next export
command in the workflow - The
next-image-export-optimizer
step is also correctly configured, matching with the image optimization settings in next.config.js
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check package.json for Next.js version
if [ -f "package.json" ]; then
echo "Next.js version:"
cat package.json | jq '.dependencies.next, .devDependencies.next'
fi
Length of output: 150
Script:
#!/bin/bash
# Check next.config.js content
if [ -f "next.config.js" ]; then
echo "next.config.js content:"
cat next.config.js
fi
Length of output: 1053
14-14
: Verify action version compatibility
The updates to GitHub Actions versions are significant:
- actions/checkout@v4
- actions/setup-node@v4
- actions/configure-pages@v4
- actions/cache@v4
- actions/upload-pages-artifact@v3
While updating to the latest versions is good practice, these are major version bumps that could introduce breaking changes.
Also applies to: 19-19, 24-24, 32-32, 51-51
✅ Verification successful
Let me check the release notes for the remaining actions to complete the verification.
Action version updates are compatible with minor implementation changes
The version updates across all GitHub Actions are safe to proceed with:
- actions/checkout@v4: Only updates Node runtime and removes progress option
- actions/setup-node@v4: Updates Node runtime and dependencies
- actions/configure-pages@v4: Updates Node runtime and centralizes .node-version
- actions/cache@v4: Updates Node runtime and adds save-always flag
- actions/upload-pages-artifact@v3: Uses upload-artifact v4 internally
The changes are primarily internal improvements and runtime updates without breaking changes to the action interfaces. However, note that upload-pages-artifact@v3 requires deploy-pages@v4 or newer for GitHub Pages deployment.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check the changelog/release notes for breaking changes in the updated actions
gh api graphql -f query='
query {
repository(owner: "actions", name: "checkout") {
release(tagName: "v4.0.0") {
description
}
}
}' | jq -r '.data.repository.release.description'
gh api graphql -f query='
query {
repository(owner: "actions", name: "setup-node") {
release(tagName: "v4.0.0") {
description
}
}
}' | jq -r '.data.repository.release.description'
Length of output: 1647
Script:
#!/bin/bash
# Check release notes for configure-pages and upload-pages-artifact
gh api graphql -f query='
query {
repository(owner: "actions", name: "configure-pages") {
release(tagName: "v4.0.0") {
description
}
}
}' | jq -r '.data.repository.release.description'
gh api graphql -f query='
query {
repository(owner: "actions", name: "upload-pages-artifact") {
release(tagName: "v3.0.0") {
description
}
}
}' | jq -r '.data.repository.release.description'
gh api graphql -f query='
query {
repository(owner: "actions", name: "cache") {
release(tagName: "v4.0.0") {
description
}
}
}' | jq -r '.data.repository.release.description'
Length of output: 1957
.github/workflows/deploy.yml (2)
39-39
: Consistent Node.js version management
The Node.js version management using .nvmrc
is consistently applied across both workflow files, which is good practice.
32-32
: Verify consistency with ci.yml action versions
The action version updates match those in ci.yml, with an additional update to deploy-pages:
- actions/checkout@v4
- actions/setup-node@v4
- actions/configure-pages@v4
- actions/cache@v4
- actions/upload-pages-artifact@v3
- actions/deploy-pages@v4 (deploy-specific)
Also applies to: 37-37, 42-42, 50-50, 68-68, 82-82
✅ Verification successful
Action versions are consistent and compatible
The action versions in both workflows are perfectly aligned:
- Both use identical versions for common actions (checkout@v4, setup-node@v4, configure-pages@v4, cache@v4, upload-pages-artifact@v3)
- deploy.yml additionally uses deploy-pages@v4, which is explicitly compatible with upload-pages-artifact@v3 per the release notes
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check deploy-pages action for breaking changes
gh api graphql -f query='
query {
repository(owner: "actions", name: "deploy-pages") {
release(tagName: "v4.0.0") {
description
}
}
}' | jq -r '.data.repository.release.description'
Length of output: 1010
Script:
#!/bin/bash
# Check action versions in ci.yml
rg "actions/.*@v\d+" .github/workflows/ci.yml
# Check action versions in deploy.yml for comparison
rg "actions/.*@v\d+" .github/workflows/deploy.yml
Length of output: 515
What this PR does / why we need it?
actions/checkout
version 3 to 4(latest)actions/setup-node
version 3 to 4(latest)actions/configure-pages
version 3 to 4(latest)actions/cache
version 3 to 4actions/upload-pages-artifact
version 1 to 3actions/deploy-pages
version 1 to 4Any background context you want to provide?
What are the relevant tickets?
Fixes #
Checklist
Summary by CodeRabbit
New Features
.nvmrc
file to manage Node.js versioning for the project.Improvements
.nvmrc
file.Style