-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
92 lines (89 loc) · 3.36 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 'Article Count Workflow'
author: 'Estee Tey'
description: 'Allows you to show the number of articles that you have published on your profile'
inputs:
feed_list:
description: "Comma separated list of RSS feed urls"
required: true
gh_token:
description: "GitHub access token with Repo scope"
required: false
default: ${{ github.token }}
redirect_link:
description: "Link to redirect user when they click on the badge. If not provided, the badge will not be a clickable."
required: false
readme_path:
description: "Path of the readme file you want to update"
default: README.md
required: false
comment_tag_name:
description: "Override the default comment tag name, if you want to show multiple instances of the action on the same repo"
default: ARTICLE_BADGE
required: false
tag_post_pre_newline:
description: "To append with newline or not"
default: "false"
required: false
badge_style:
description: "Style of badge to be applied, refer to Shields.io website for the styles they offer"
default: 'flat-square'
required: false
badge_label:
description: "Text to be shown on the left side of the badge (label)"
default: blog
required: false
badge_logo:
description: "Logo to be shown on the left side of the badge (label)"
default: ""
required: false
badge_message_suffix:
description: "Text to be appended as suffix to the right side of the badge (message). For example, a suffix of 'pieces' will result in a message showing '20 pieces'"
default: articles
required: false
badge_message_bg_color:
description: "Background color of the right side of the badge (message). Accepts colors like 'green', hex values like '#F9D3C6'"
default: "green"
required: false
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Running Gautam's Blog post workflow
uses: gautamkrishnar/blog-post-workflow@master
id: blogpost_workflow
with:
feed_list: ${{inputs.feed_list}}
max_post_count: 1000000
output_only: true
- name: Saves count as an output
shell: bash
id: count-step
run: echo "::set-output name=articles_length::$(jq '. | length' /tmp/blog_post_workflow_output.json)"
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Generate Badge
shell: bash
env:
articles_length: ${{ fromJSON(steps.count-step.outputs.articles_length) }}
redirect_link: ${{inputs.redirect_link}}
comment_tag_name: ${{inputs.comment_tag_name}}
readme_path: ${{inputs.readme_path}}
badge_style: ${{inputs.badge_style}}
badge_label: ${{inputs.badge_label}}
badge_logo: ${{inputs.badge_logo}}
badge_message_bg_color: ${{inputs.badge_message_bg_color}}
badge_message_suffix: ${{inputs.badge_message_suffix}}
run: |
cd ${{github.action_path}} && npm install && node articleCount.js
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Article Count Badge
commit_user_name: Article Count Badge Generator Action # defaults to "GitHub Actions"
commit_user_email: [email protected] # defaults to "[email protected]"
commit_author: Github Action Bot <[email protected]> # defaults to author of the commit that triggered the run
branding:
icon: 'activity'
color: 'blue'