Skip to content

Commit

Permalink
✨ Support set color for new week badge
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-Xu-0100 committed Nov 6, 2020
1 parent c86ee1f commit 46b343d
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 7 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ The emoji used in the `GitHub` commit message is based on [gitmoji](https://gitm

## [Unreleased]

## [1.2.1] - 2020-11-06

### ✨ Added

- ✨ support set color for `views/week` and `clones/week` badge.

### ♻️ Changed

- 📝 update readme.

## [1.2.0] - 2020-11-04

### ✨ Added
Expand Down Expand Up @@ -113,7 +123,8 @@ The emoji used in the `GitHub` commit message is based on [gitmoji](https://gitm
- 👷 [workflows](./.github/workflows/autoRelease.yml) to auto release
- 👷 [prettier](./.prettierrc.json) to format files

[unreleased]: https://github.com/yi-Xu-0100/traffic-to-badge/compare/v1.2.0...HEAD
[unreleased]: https://github.com/yi-Xu-0100/traffic-to-badge/compare/v1.2.1...HEAD
[1.2.1]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.2.1
[1.2.0]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.2.0
[1.1.6]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.1.6
[1.1.5]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.1.5
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

## [未发布的]

## [1.2.1] - 2020-11-06

### ✨ 增加

- ✨ 支持设置 `views/week``clones/week` 徽章。

### ♻️ 变化

- 📝 更新 readme。

## [1.2.0] - 2020-11-04

### ✨ 增加
Expand Down Expand Up @@ -113,7 +123,8 @@
- 👷 自动发布 release 的 [工作流](./.github/workflows/autoRelease.yml)
- 👷 [prettier](./.prettierrc.json) 格式化文件

[unreleased]: https://github.com/yi-Xu-0100/traffic-to-badge/compare/v1.2.0...HEAD
[unreleased]: https://github.com/yi-Xu-0100/traffic-to-badge/compare/v1.2.1...HEAD
[1.2.1]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.2.1
[1.2.0]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.2.0
[1.1.6]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.1.6
[1.1.5]: https://github.com/yi-Xu-0100/traffic-to-badge/tree/v1.1.5
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ inputs:
Set a hex or named color value for the clones badge background.
required: false
default: brightgreen
views_week_color:
description: >
Set a hex or named color value for the views per week badge background.
required: false
default: brightgreen
clones_week_color:
description: >
Set a hex or named color value for the clones per week badge background.
required: false
default: brightgreen
logo:
description: >
Insert a named logo or simple-icon to the left of the label.
Expand Down Expand Up @@ -115,13 +125,15 @@ jobs:
- name: Set Traffic
id: traffic
uses: yi-Xu-0100/traffic-to-badge@v1.1.6
uses: yi-Xu-0100/traffic-to-badge@v1.2.1
with:
my_token: ${{ secrets.TRAFFIC_TOKEN }}
#(default) static_list: ${{ github.repository }}
#(default) traffic_branch: traffic
#(default) views_color: brightgreen
#(default) clones_color: brightgreen
#(default) views_week_color: brightgreen
#(default) clones_week_color: brightgreen
#(default) logo: github
#(default) year:

Expand Down
14 changes: 13 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ input:
为 clones 徽章背景设置一个十六进制或命名的颜色值。
required: false
default: brightgreen
views_week_color:
description: >
为 views/week 徽章背景设置一个十六进制或命名的颜色值。
required: false
default: brightgreen
clones_week_color:
description: >
为 clones/week 徽章背景设置一个十六进制或命名的颜色值。
required: false
default: brightgreen
logo:
description: >
在标签左侧插入命名的徽标或简单图标。
Expand Down Expand Up @@ -114,13 +124,15 @@ jobs:

- name: Set Traffic
id: traffic
uses: yi-Xu-0100/traffic-to-badge@v1.1.6
uses: yi-Xu-0100/traffic-to-badge@v1.2.1
with:
my_token: ${{ secrets.TRAFFIC_TOKEN }}
#(default) static_list: ${{ github.repository }}
#(default) traffic_branch: traffic
#(default) views_color: brightgreen
#(default) clones_color: brightgreen
#(default) views_week_color: brightgreen
#(default) clones_week_color: brightgreen
#(default) logo: github
#(default) year:

Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ inputs:
Set a hex or named color value for the clones badge background.
required: false
default: brightgreen
views_week_color:
description: >
Set a hex or named color value for the views per week badge background.
required: false
default: brightgreen
clones_week_color:
description: >
Set a hex or named color value for the clones per week badge background.
required: false
default: brightgreen
logo:
description: >
Insert a named logo or simple-icon to the left of the label.
Expand Down
12 changes: 11 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ async function run() {
info(`[INFO]: views_color: ${views_color}`);
const clones_color = getInput('clones_color', { require: false });
info(`[INFO]: clones_color: ${clones_color}`);
const views_week_color = getInput('views_week_color', { require: false });
info(`[INFO]: views_week_color: ${views_week_color}`);
const clones_week_color = getInput('clones_week_color', { require: false });
info(`[INFO]: clones_week_color: ${clones_week_color}`);
const logo = getInput('logo', { require: false });
info(`[INFO]: logo: ${logo}`);
const year = getInput('year', { require: false });
Expand All @@ -54,7 +58,13 @@ async function run() {
await dataGenerator(traffic_data, traffic_data_path);
debug('Start generate SVG');
await SVGGenerator(traffic_data, traffic_data_path, views_color, clones_color, logo);
await Week_SVGGenerator(latest_week_data, traffic_data_path, views_color, clones_color, logo);
await Week_SVGGenerator(
latest_week_data,
traffic_data_path,
views_week_color,
clones_week_color,
logo
);
endGroup();
}
startGroup(`Generate LICENSE and README.md`);
Expand Down

0 comments on commit 46b343d

Please sign in to comment.