Skip to content

Commit

Permalink
init project.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 28, 2024
0 parents commit 51650d4
Show file tree
Hide file tree
Showing 13 changed files with 38,220 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ko_fi: jaywcjlove
buy_me_a_coffee: jaywcjlove
custom: ["https://www.paypal.me/kennyiseeyou", "https://jaywcjlove.github.io/#/sponsor"]
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: test
on:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm install
- run: npm run build
- run: mkdir -p build

- name: Output src/ folder tree
# uses: jaywcjlove/github-action-folder-tree@main
uses: ./
with:
path: ./src

- name: Create idoc config
run: |
cat > idoc.yml << EOF
site: "Folder Tree {{version}}"
menus:
Home: index.html
Sponsor: https://jaywcjlove.github.io/#/sponsor
footer: |
<a href="https://jaywcjlove.github.io/#/sponsor" target="_blank">Sponsor</a> •
<a href="https://jaywcjlove.github.io/changelog-generator" target="_blank">Changelog Generator</a> •
<a href="https://jaywcjlove.github.io/create-tag-action" target="_blank">Create Tag</a> •
<a href="https://jaywcjlove.github.io/github-action-contributors" target="_blank">Contributors</a> •
<a href="https://jaywcjlove.github.io/generated-badges" target="_blank">Generated Badges</a>
<br />
Released under the MIT License. Copyright © {{idocYear}} Kenny Wong<br />
Generated by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a> v{{idocVersion}}
EOF
- run: npm install idoc@1 -g
- run: idoc
- name: gh-pages README.md
working-directory: dist
run: |
cat > README.md << EOF
Website: https://jaywcjlove.github.io/github-action-folder-tree
EOF
- name: Is a tag/release created auto?
id: create_tag
uses: jaywcjlove/create-tag-action@main
with:
# test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
package-path: ./package.json

- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@main

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
head-ref: ${{steps.create_tag.outputs.version}}
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- name: Create Release
uses: jaywcjlove/create-tag-action@main
with:
# test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
package-path: ./package.json
release: true
body: |
[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/github-action-folder-tree/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
```yml
- name: Read README.md
id: package
uses: jaywcjlove/github-action-folder-tree@main
with:
path: package.json
- name: Echo package.json
run: echo "$\{{ steps.package.outputs.content }}"
```
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
build
lib
node_modules

npm-debug.log*
lerna-debug.log
yarn-error.log
package-lock.json

.DS_Store
.cache
.vscode
.idea
.env

*.mpassword
*.bak
*.tem
*.temp
#.swp
*.*~
~*.*

# IDEA
*.iml
*.ipr
*.iws
.idea/
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.ts": [
"npm run build"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 小弟调调™

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Print folder tree
===

[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
[![test](https://github.com/jaywcjlove/github-action-folder-tree/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/github-action-folder-tree/actions/workflows/ci.yml)

View the folder directory tree structure, similar to the output of the `tree` command

## Example Usage

```yml
- name: Print Folder Tree
uses: jaywcjlove/github-action-folder-tree@main
with:
path: ./src
depth: 2
```
## Inputs
- `path` Folder path. (default `./`)
- `depth` Scan the maximum depth reachable for the given path (default `5`)

## Outputs

- `content` Directory tree structure text

## See Also

- [Github Release Changelog Generator](https://github.com/jaywcjlove/changelog-generator) A GitHub Action that compares the commit differences between two branches
- [Create Tags From](https://github.com/jaywcjlove/create-tag-action) Auto create tags from commit or package.json.
- [Github Action Contributors](https://github.com/jaywcjlove/github-action-contributors) Github action generates dynamic image URL for contributor list to display it!
- [Generated Badges](https://github.com/jaywcjlove/generated-badges) Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)
- [Create Coverage Badges](https://github.com/jaywcjlove/coverage-badges-cli) Create coverage badges from coverage reports. (no 3rd parties servers)
- [Github Action package](https://github.com/jaywcjlove/github-action-package) Read and modify the contents of `package.json`.
- [Github Action EJS](https://github.com/jaywcjlove/github-action-package) A github action to render a ejs template using github context.
- [Modify File Content](https://github.com/jaywcjlove/github-action-modify-file-content) Replace text content and submit content.

## License

Licensed under the MIT License.
28 changes: 28 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Print folder tree'
author: 'Kenny Wong'
description: 'View the folder directory tree structure, similar to the output of the `tree` command'
inputs:
token:
description: 'Your GITHUB_TOKEN'
default: ${{ github.token }}
required: false
path:
description: 'Folder path'
default: ''
required: false
depth:
description: 'Scan the maximum depth reachable for the given path'
default: 5
required: false

outputs:
content:
description: 'Directory tree structure text'

runs:
using: 'node20'
main: 'dist/index.js'

branding:
icon: 'file'
color: 'purple'
Loading

0 comments on commit 51650d4

Please sign in to comment.