generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b87b68f
commit 08f7946
Showing
6 changed files
with
71 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,39 +30,48 @@ The GitHub action that using repositories `Insights/traffic` data to generate ba | |
```yaml | ||
inputs: | ||
my_token: | ||
description: 'Set up a personal access token to obtain the secret repository traffic data.' | ||
description: > | ||
Set up a personal access token to obtain the secret repository traffic data. | ||
required: true | ||
static_list: | ||
description: 'Set up a list of repositories to get.' | ||
required: true | ||
description: > | ||
Set up a list of repositories to get. | ||
Only when github.repository with setting into first item, | ||
it can be correct to be current repository name. | ||
required: false | ||
default: ${{ github.repository }} | ||
traffic_branch: | ||
description: 'If empty traffic data will be backed up to the branch named traffic.' | ||
description: > | ||
If empty traffic data will be backed up to the branch named traffic. | ||
required: false | ||
default: 'traffic' | ||
default: traffic | ||
views_color: | ||
description: 'Set a hex or named color value for the views badge background.' | ||
description: > | ||
Set a hex or named color value for the views badge background. | ||
required: false | ||
default: 'brightgreen' | ||
default: brightgreen | ||
clones_color: | ||
description: 'Set a hex or named color value for the clones badge background.' | ||
description: > | ||
Set a hex or named color value for the clones badge background. | ||
required: false | ||
default: 'brightgreen' | ||
default: brightgreen | ||
logo: | ||
description: 'Insert a named logo or simple-icon to the left of the label.' | ||
description: > | ||
Insert a named logo or simple-icon to the left of the label. | ||
required: false | ||
default: 'github' | ||
default: github | ||
|
||
outputs: | ||
traffic_branch: | ||
description: 'Origin traffic data branch name' | ||
description: > | ||
Origin traffic data branch name | ||
traffic_path: | ||
description: 'Path to generate traffic data' | ||
description: > | ||
Path to generate traffic data | ||
``` | ||
## 📝 Example usage | ||
**[`repo-list-generator`](https://github.com/marketplace/actions/repo-list-generator): The output `repo` only include current repository name.** | ||
|
||
```yaml | ||
name: traffic2badge | ||
on: | ||
|
@@ -80,16 +89,12 @@ jobs: | |
- name: Checkout Code | ||
uses: actions/[email protected] | ||
|
||
- name: Get Repo List | ||
id: repo | ||
uses: yi-Xu-0100/[email protected] | ||
- name: Get Traffic | ||
id: traffic | ||
uses: yi-Xu-0100/[email protected] | ||
with: | ||
my_token: ${{ secrets.TRAFFIC_TOKEN }} | ||
static_list: ${{ steps.repo.outputs.repo }} | ||
#(default) static_list: ${{ github.repository }} | ||
#(default) traffic_branch: traffic | ||
#(default) views_color: brightgreen | ||
#(default) clones_color: brightgreen | ||
|
@@ -105,7 +110,7 @@ jobs: | |
**More usage example:** | ||
- [yi-Xu-0100/traffic2badge](https://github.com/yi-Xu-0100/traffic2badge) - Template repository for usage. | ||
- [`yi-Xu-0100/traffic2badge`](https://github.com/yi-Xu-0100/traffic2badge) - Template repository for usage with [`yi-Xu-0100/repo-list-generator`] which generate `repoList` for `static_list`. | ||
|
||
## 📝 Use dependabot to keep action up-to-date | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,39 +30,47 @@ | |
```yaml | ||
input: | ||
my_token: | ||
description: '设置用以获取私密存储库流量数据的个人访问令牌。' | ||
description: > | ||
'设置用以获取私密存储库流量数据的个人访问令牌。' | ||
required: true | ||
static_list: | ||
description: '设置一个想要获取的存储库列表。' | ||
required: true | ||
description: > | ||
'设置一个想要获取的存储库列表。 | ||
只有 github.repository 设置为第一个值时才可以被修正为当前仓库名。' | ||
required: false | ||
default: ${{ github.repository }} | ||
traffic_branch: | ||
description: '如果为空,则流量数据将备份到名为 traffic 的分支中。' | ||
description: > | ||
'如果为空,则流量数据将备份到名为 traffic 的分支中。' | ||
required: false | ||
default: 'traffic' | ||
views_color: | ||
description: '为 views 徽章背景设置一个十六进制或命名的颜色值。' | ||
description: > | ||
'为 views 徽章背景设置一个十六进制或命名的颜色值。' | ||
required: false | ||
default: 'brightgreen' | ||
clones_color: | ||
description: '为 clones 徽章背景设置一个十六进制或命名的颜色值。' | ||
description: > | ||
'为 clones 徽章背景设置一个十六进制或命名的颜色值。' | ||
required: false | ||
default: 'brightgreen' | ||
logo: | ||
description: '在标签左侧插入命名的徽标或简单图标。' | ||
description: > | ||
'在标签左侧插入命名的徽标或简单图标。' | ||
required: false | ||
default: 'github' | ||
|
||
outputs: | ||
traffic_branch: | ||
description: '原 traffic 分支名' | ||
description: > | ||
'原 traffic 分支名' | ||
traffic_path: | ||
description: '生成 traffic 数据的路径' | ||
description: > | ||
'生成 traffic 数据的路径' | ||
``` | ||
## 📝 示例 | ||
**[`repo-list-generator`](https://github.com/marketplace/actions/repo-list-generator) :输出值 `repo` 仅包含当前仓库名称。** | ||
|
||
```yaml | ||
name: traffic2badge | ||
on: | ||
|
@@ -80,16 +88,12 @@ jobs: | |
- name: Checkout Code | ||
uses: actions/[email protected] | ||
|
||
- name: Get Repo List | ||
id: repo | ||
uses: yi-Xu-0100/[email protected] | ||
- name: Get Traffic | ||
id: traffic | ||
uses: yi-Xu-0100/[email protected] | ||
with: | ||
my_token: ${{ secrets.TRAFFIC_TOKEN }} | ||
static_list: ${{ steps.repo.outputs.repo }} | ||
#(default) static_list: ${{ github.repository }} | ||
#(default) traffic_branch: traffic | ||
#(default) views_color: brightgreen | ||
#(default) clones_color: brightgreen | ||
|
@@ -105,7 +109,7 @@ jobs: | |
**更多使用示例:** | ||
- [yi-Xu-0100/traffic2badge](https://github.com/yi-Xu-0100/traffic2badge) - 模板仓库. | ||
- [`yi-Xu-0100/traffic2badge`](https://github.com/yi-Xu-0100/traffic2badge) - 使用 [`yi-Xu-0100/repo-list-generator`] 的模板仓库,其中 `repo-list-generator` 产生 `repoList` 用于 `static_list`. | ||
|
||
## 📝 使用 `dependabot` 使 `action` 保持更新 | ||
|
||
|
@@ -123,7 +127,7 @@ updates: | |
|
||
## 🙈 生成 `my_token` | ||
|
||
> 这部分是从 [sangonzal/repository-traffic-action](https://github.com/sangonzal/repository-traffic-action) 获得的。 | ||
> 这部分是从 [`sangonzal/repository-traffic-action`](https://github.com/sangonzal/repository-traffic-action) 获得的。 | ||
|
||
首先,您需要创建一个个人访问令牌(`PAT`),使该操作可以访问 `GitHub API`。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters