-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Template Cleanup action #264
base: main
Are you sure you want to change the base?
Conversation
@idkgene is attempting to deploy a commit to the Hayden Bleasel Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes include modifications to an existing GitHub Actions workflow in Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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: 2
🧹 Outside diff range and nitpick comments (2)
.github/workflows/template-cleanup.yml (2)
2-8
: Consider adding additional trigger conditionsThe workflow currently runs on every push to main. Consider adding conditions to ensure it only runs once, such as checking if this is the first commit after repository creation.
on: push: branches: [main] + paths-ignore: + - '.github/workflows/template-cleanup.yml'
16-20
: Optimize repository checkoutSetting
fetch-depth: 0
fetches the entire repository history, which is unnecessary for this workflow. A shallow clone would be more efficient.- name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/release.yml
(1 hunks).github/workflows/template-cleanup.yml
(1 hunks)
🔇 Additional comments (2)
.github/workflows/template-cleanup.yml (1)
11-14
: LGTM! Good job on the conditional check
The condition github.event.repository.is_template == false
ensures the cleanup only runs when a new repository is created from the template, not on the template itself.
.github/workflows/release.yml (1)
15-18
: LGTM! The condition is well-structured and aligns with the PR objectives.
The additional check to skip releases for "Initial commit" messages is a good safeguard to prevent unnecessary releases during template cleanup.
Let's verify the interaction between this workflow and the template cleanup process:
Description
Introduces Template Cleanup Workflow, which removes template-specific files and configurations when a new repository is created from this template. We need this because GitHub has no built-in functionality to exclude certain folders and files from the template repo
Related Issues
#261 (The workflow code from the example in here)
Checklist
Current behavior:
2024-11-19.11-22-31.mp4
Expected behavior
2024-11-19.11-35-00.mp4
Additional Notes
It takes the list of files to delete from here https://github.com/haydenbleasel/next-forge/blob/main/scripts/init.js and deletes the scripts folder as well. "Initial commit" is the default commit message when you create a repo from a template.
My test repo with the workflow implemented is here: https://github.com/idkgene/next-forge-main
Possible improvement to consider
To override the first default message we can use something like this in a workflow (for example like in here - https://github.com/PaulRBerg/hardhat-template/blob/main/.github/workflows/use-template.yml)
Summary by CodeRabbit