-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
82 lines (78 loc) · 2.47 KB
/
action.yaml
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
name: 'pub-dashboard'
description: 'Package Dashboard Table (pub.dev)'
author: 'AmosHuKe'
branding:
icon: activity
color: blue
inputs:
github_token:
description: 'Github Token with repo permissions'
required: true
github_repo:
description: 'Github repo to be manipulated'
required: true
commit_message:
description: 'Commit message'
required: false
default: 'docs(pub-dashboard): pub-dashboard has updated readme'
committer_username:
description: 'Committer username'
required: false
default: 'github-actions[bot]'
committer_email:
description: 'Committer email'
required: false
default: '41898282+github-actions[bot]@users.noreply.github.com'
filename:
description: 'Filename in Github repo (github_repo)'
required: false
default: README.md
publisher_list:
description: 'e.g fluttercandies.com,bb,cc'
required: false
package_list:
description: 'e.g flutter_tilt,bb,cc'
required: false
sort_field:
description: 'name | published | pubLikes | githubStars'
required: false
default: name
sort_mode:
description: 'asc | desc'
required: false
default: asc
runs:
using: 'composite'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set GitHub Path
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
- name: Clone repo
run: |
tempPath="${{ github.action_path }}/temp/repo"
git clone ${{ inputs.github_repo }} $tempPath
cd $tempPath
shell: bash
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: '${{ github.action_path }}/go.mod'
cache: false
id: go
- name: Update Markdown
env:
GH_TOKEN: ${{ inputs.github_token }}
run: |
tempPath="${{ github.action_path }}/temp/repo"
go run ${{ github.action_path }}/main.go -githubToken ${{ inputs.github_token }} -filename $tempPath/${{ inputs.filename }} -publisherList ${{ inputs.publisher_list }} -packageList ${{ inputs.package_list }} -sortField ${{ inputs.sort_field }} -sortMode ${{ inputs.sort_mode }}
cd $tempPath
gh auth setup-git -h github.com
git config user.name "${{ inputs.committer_username }}"
git config user.email "${{ inputs.committer_email }}"
git commit -a -m "${{ inputs.commit_message }}"
git push
shell: bash