{"id":15612426,"url":"https://github.com/euberdeveloper/ga-dree","last_synced_at":"2025-03-29T15:13:11.718Z","repository":{"id":65974316,"uuid":"603582123","full_name":"euberdeveloper/ga-dree","owner":"euberdeveloper","description":"The github action for dree","archived":false,"fork":false,"pushed_at":"2024-05-21T20:46:06.000Z","size":1204,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-03T00:33:15.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/euberdeveloper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-19T00:07:06.000Z","updated_at":"2024-05-21T20:46:10.000Z","dependencies_parsed_at":"2024-01-30T17:44:59.043Z","dependency_job_id":"29f4c110-be13-4456-8484-edcb31c2fb64","html_url":"https://github.com/euberdeveloper/ga-dree","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euberdeveloper%2Fga-dree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euberdeveloper%2Fga-dree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euberdeveloper%2Fga-dree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euberdeveloper%2Fga-dree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/euberdeveloper","download_url":"https://codeload.github.com/euberdeveloper/ga-dree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246200323,"owners_count":20739566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T06:42:51.282Z","updated_at":"2025-03-29T15:13:11.684Z","avatar_url":"https://github.com/euberdeveloper.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v3-undefined.svg?logo=github\u0026logoColor=white\u0026style=flat)](https://github.com/marketplace/actions/ga-project-version)\n\n# ga-dree\nThis github action is mainly used to generate a nice directory tree representation of the github repo in markdown files, injected where a specific comment is specified.\n\n## Project purpose\n\nIn many Github projects it is nice to put a **directory tree representation** in the **README**, to give an overview of the structure of the project, without making a user to inspect the various files and folders. This action does exactly this: it's basic usage generates a directory tree representation of the repository and injects it in the README file, where a specific comment is specified. It is also **customizable**, so you can choose which markdown file should be injected, which comment triggers the injection and other options, (e.g. exclude some files/folders from the tree representation).\n\n## Dree\n\nThis action is based on the **[dree npm module](https://dree.euber.dev)**. Indeed, the config file that can be specified is the same config file that could be provided to that module.\n\n## Result\n\nLet's suppose that this is your markdown file:\n\n```md\n# My project\n\nA description of my project\n\n## Directory tree\n\n[//]: # (dree)\n\n```\n\nThe result will be something like:\n\n```md\n\n# My project\n\nA description of my project\n\n## Directory tree\n\n[//]: # (dree - BEGIN)\nmyproject\n ├── LICENSE\n ├── README.md\n └─\u003e sample\n     ├── primo.java\n     ├─\u003e prova1\n     │   └── secondo.yml\n     ├─\u003e prova2\n     │   ├── ciao.html\n     │   └── pippo.txt\n     └─\u003e prova3\n         ├─\u003e terzo\n         │   └── quarto.ts\n         └── quinto.js\n[//]: # (dree - END)\n\n```\n\n## Example\n\nA simple example:\n\n```yml\nname: release\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v3\n        with:\n            ref: main\n      \n      # This is how you use the ga-dree action\n      - name: Inject dree\n        uses: 'euberdeveloper/ga-dree@main'\n\n      # In this step the changes to the branch are committed\n      - name: Commit changes\n        uses: stefanzweifel/git-auto-commit-action@v4\n        with:\n          commit_message: \"docs: inject dree (automated commit)\"\n          branch: main\n\n```\n\nA more advanced exmaple:\n\n```yml\nname: release\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v3\n        with:\n            ref: main\n      \n      # This is how you use the ga-dree action\n      - name: Inject dree\n        uses: 'euberdeveloper/ga-dree@main'\n        with:\n            showMadeWithDree: 'false' # Does not add \"Made with dree\"\n            config: './docs/dree-config.json' # The path to the config file for the package dree\n            comment: 'my-custom-dree-comment' # The comment that triggers the injection of the dree tree\n            root: './source' # The root directory of the generated tree\n            exclude: 'node_modules' # The files/folders to exclude from the tree\n            targetPath: './docs/README.md' # The path of the file where the tree should be injected\n\n      # In this step the changes to the branch are committed\n      - name: Commit changes\n        uses: stefanzweifel/git-auto-commit-action@v4\n        with:\n          commit_message: \"docs: inject dree (automated commit)\"\n          branch: main\n\n```\n\n## API\n\n### Supported Parameters\n\n| Parameter          | Description                                                                                                          | Default       |\n|--------------------|----------------------------------------------------------------------------------------------------------------------|---------------|\n| `targetPath`       | A direct path to the markdown file with the comment where the directory tree will be injected                        | `./README.md` |\n| `comment`          | The comment that will be replaced with the directory tree. Note: it will be of the format `[//]: # (comment)`        | `dree`        |\n| `root`             | The directory to be scanned                                                                                          | `.`           |\n| `config`           | The path to the dree configuration file                                                                              | `undefined`   |\n| `showMadeWithDree` | Add the \"Made with dree\" text after the dree text                                                                    | `true`        |\n| `exclude`          | The paths that will be excluded from the directory tree, separated by comma *(note: overwritten by the config file)* | `.git/**`       |\n\n**Note:** If `config` is specified, `exclude` is ignored.\n\n## How does it works\n\n### How is it made\n\nInternally, the action is written in **Typescript**, tested with **Jest** and bundled with **EsBuild**.\n\n### Steps that are followed\n\nThis is what it happens under the hood:\n* The action options are parsed\n* The action generates the tree representation of the repository, by considering the options regarding [dree](https://dree.euber.dev) and the tree representation\n* The action generates the markdown that will be injected, in particular, it adds the \"made with dree\" if specified and the \"begin-end\" comments for the subsequent injections\n* The action injects the markdown in the specified markdown file, comment added by the users will be replaced by the directory tree and the begin-end comments, while already present begin-end comments will be replaced, with their content, with the new injected markdown.\n\n### Note\n\nThere is the assumption that the begin-end comments are added consistently, so there is no new \"begin\" comment before another \"begin\" comment is not closed, or there is no new \"end\" comment before a \"begin\" comment is opened.\n\n### Development\n\nThe commits are pushed to the branch `dev`, after that an action will generate the bundle and push everything in the branch `main`. For versioning, releases are manually created.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuberdeveloper%2Fga-dree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feuberdeveloper%2Fga-dree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuberdeveloper%2Fga-dree/lists"}