diff --git a/README.md b/README.md index 5f27a1e..1c15aa0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/luob/create-my-awesome/build-test) ![GitHub top language](https://img.shields.io/github/languages/top/luob/create-my-awesome) -Github Actions for automatically generating the personal awesome list from all of the repositories you starred. +Github Actions for automatically generating a personal awesome project to organize all your starred repositories. ## Usage @@ -38,18 +38,19 @@ jobs: GITHUB_TOKEN: ${{ github.token }} ``` -- Pushing changes with `${{ github.token }}` will not create a new workflow run, this prevents you from accidentally creating recursive workflow runs. So don't warry about trigger it on changes. - +- Pushing changes to Github with repositories's token(`${{ github.token }}`) will not create a new workflow run, so don't warry about creating recursive workflow runs. ## Advance Usage -You can customize the description: - ```yaml # ... - uses: luob/create-my-awesome@v1.0.0-alpha.2 with: - description: 'A liSt oF awesOme thiNgs.', + # You can use the data of any Github user, default to the owner of the repository + username: zhang-san + # customize the description, default to 'A collection of awesome things.' + description: 'A cOllectiOn OF awesOme thiNgs.', + # customize the target directory. Default to the root. targetDir: ./target/ # ... ``` diff --git a/README.zh-Hans.md b/README.zh-Hans.md new file mode 100644 index 0000000..6748818 --- /dev/null +++ b/README.zh-Hans.md @@ -0,0 +1,74 @@ +# Create My Awesome + +![GitHub release](https://img.shields.io/github/v/release/luob/create-my-awesome) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/luob/create-my-awesome/build-test) +![GitHub top language](https://img.shields.io/github/languages/top/luob/create-my-awesome) + +Github Actions, 用于自动生成一个Awesome项目来整理所有你star过的仓库 + +## Usage + +1. [新建一个Github仓库](https://github.com/new) +2. 在这个仓库中, [新建一个GitHub Actions 工作流程](https://docs.github.com/cn/free-pro-team@latest/actions/quickstart) 然后把下面的内容复制到 `.yml` 文件里 + +```yaml + +name: 'build' +on: + push: + branches: + - main + schedule: + # UTC时间每天00:00执行 + # 如果想在北京时间00:00执行,应该是 '0 16 * * *' + # 更多例子见 https://crontab.guru/examples.html + - cron: '0 0 * * *' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: luob/create-my-awesome@v1.0.0-alpha.2 + # 提交更改 + # 见 https://github.com/EndBug/add-and-commit + - uses: EndBug/add-and-commit@v5 + with: + message: 'Update README.md' + env: + GITHUB_TOKEN: ${{ github.token }} +``` + +使用仓库提供的`token`(`${{ github.token }}`)向Github提交更改并不会触发新工作流程, 不用担心这个工作流程会造成死循环. + +## 更多用法 + +```yaml + # ... + - uses: luob/create-my-awesome@v1.0.0-alpha.2 + with: + # 你可以使用任何Github用户的数据, 默认是仓库所有人 + username: zhang-san + # 自定义项目描述, 默认是'A collection of awesome things.' + description: 'A cOllectiOn OF awesOme thiNgs.', + # 自定义目标文件夹, 默认是项目根目录 + targetDir: ./target/ + # ... +``` + +## 贡献 + +```sh + npm i + npm run all +``` + +如果要本地运行, 可以修改`.env.example`文件中的变量然后另存为`.env`. 然后运行: + +```sh + npm run local +``` + +## 版权 + +[MIT](LICENSE) \ No newline at end of file diff --git a/action.yml b/action.yml index d34c1e1..8bfb8d8 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ name: Create My Awesome description: > - automatically generating the personal awesome list from all of the repositories you starred. + Github Actions for automatically generating a personal awesome project to organize all your starred repositories. author: luob branding: icon: book @@ -28,7 +28,7 @@ inputs: default: ${{ github.token }} targetDir: - default: ./ + default: ${{ github.workspace }} runs: using: 'node12' diff --git a/package.json b/package.json index 8c68c38..63f658a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "create-my-awesome", "version": "1.0.0", "private": true, - "description": "Github Actions for automatically generating the personal awesome list from all of the repositories you starred.", + "description": "Github Actions for automatically generating a personal awesome project to organize all your starred repositories", "main": "lib/main.js", "scripts": { "build": "tsc",