feat: add GitHub Action to auto-update project_structure.txt#496
feat: add GitHub Action to auto-update project_structure.txt#496M4dhav merged 15 commits intoAOSSIE-Org:devfrom
Conversation
- Move greet_contributors.yml from .github/WORK_FLOW/ to .github/workflows/ - GitHub Actions requires workflows to be in .github/workflows/ directory - This fixes the workflow not triggering on issues/PRs - Added permissions, error handling, and logging improvements Fixes AOSSIE-Org#462
…-workflow-path fix: resolve greet contributors workflow by moving to correct directory and adding reliability improvements
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughA new GitHub Actions workflow is added to automatically generate and update a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Assessment against linked issues
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/update-project-structure.yml (1)
13-13: Update checkout action to v4 (v3 flagged as outdated).
actions/checkout@v3is already in maintenance-only mode and the latest runners ship with v4. Upgrading avoids deprecation surprises and gets you the improved default auth handling.- uses: actions/checkout@v3 + uses: actions/checkout@v4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-project-structure.yml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/update-project-structure.yml
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
| - name: Generate project_structure.txt | ||
| run: | | ||
| tree -a -I 'node_modules|.git|build|.dart_tool|*.lock|*.pyc' > project_structure.txt |
There was a problem hiding this comment.
tree is not pre-installed on ubuntu-latest; the step will fail.
GitHub-hosted runners do not include tree by default, so this command exits with 127. Install it first or switch to a pure-Git solution (git ls-files). Example fix:
+ - name: Install dependencies
+ run: sudo apt-get update && sudo apt-get install -y tree
+
- name: Generate project_structure.txt
run: |
tree -a -I 'node_modules|.git|build|.dart_tool|*.lock|*.pyc' > project_structure.txt📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Generate project_structure.txt | |
| run: | | |
| tree -a -I 'node_modules|.git|build|.dart_tool|*.lock|*.pyc' > project_structure.txt | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y tree | |
| - name: Generate project_structure.txt | |
| run: | | |
| tree -a -I 'node_modules|.git|build|.dart_tool|*.lock|*.pyc' > project_structure.txt |
🤖 Prompt for AI Agents
In .github/workflows/update-project-structure.yml at lines 15 to 17, the
workflow uses the `tree` command which is not pre-installed on the
`ubuntu-latest` runner, causing the step to fail. Fix this by adding a step
before this to install `tree` using `sudo apt-get update && sudo apt-get install
-y tree`, or replace the `tree` command with a pure Git alternative like `git
ls-files` to generate the project structure without external dependencies.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.github/workflows/update-project-structure.yml (2)
15-17:treepackage still not installed – step will exit 127
GitHub-hosted runners don’t includetree; the previous review already raised this. Add an install step or switch to a pure-Git solution.+ - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y tree + - name: Generate project structure run: | tree -a -I 'node_modules|.git' > project_structure.txt
8-10: Skip job when the actor is the bot to prevent infinite commit loop
Every push generated by this workflow re-triggers itself. Guard the job with anif:condition.jobs: generate-structure: + if: github.actor != 'github-actions[bot]' runs-on: ubuntu-latest
🧹 Nitpick comments (2)
.github/workflows/update-project-structure.yml (2)
19-25: Make the commit step idempotent to avoid failures when nothing changes
git commitexits 1 when there are no diffs, causing the job to fail. Short-circuit the commit or use--allow-empty.- name: Commit and push changes run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add project_structure.txt - git commit -m "chore: update project structure" + git diff --cached --quiet || git commit -m "chore: update project structure" git push
25-25: Add a trailing newline to satisfy YAML-lint
Minor style nit—prevents thenew-line-at-end-of-filewarning.- git push⏎ + git push +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-project-structure.yml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/update-project-structure.yml
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/update-project-structure.yml
[error] 25-25: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (1)
.github/workflows/update-project-structure.yml (1)
3-7: Verify default branch name
The trigger targetsmaster, but many repos (including new GitHub defaults) usemain. Ensure this matches Resonate’s default branch to avoid the workflow never running.
M4dhav
left a comment
There was a problem hiding this comment.
Please make these changes and change the base of the PR from master to dev
|
@M4dhav I've made all the requested changes. Let me know if anything else is needed! |
|
Also resolve the conflict with base branch |
|
@M4dhav Please have a look now! |
|
Great Work! Thank you for your contribution! |
Description
This PR adds a GitHub Action workflow that automatically generates a
project_structure.txtfile whenever a new push is made. This helps contributors and maintainers quickly view the structure of the repository.Fixes #475
Type of change
How Has This Been Tested?
Tested by committing and pushing the workflow to a new branch. Verified that the GitHub Action runs successfully and creates
project_structure.txtin the root of the repo.Checklist:
Summary by CodeRabbit
Summary by CodeRabbit