-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
38 lines (37 loc) · 1.05 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
name: 'docsify-file-catalog-action'
description: 'generate _sidebar.md to show the file catalog'
inputs:
github_token:
description: 'github_token'
required: true
include:
description: 'Included files(regular expression)'
default: '.*\.md'
# outputs:
runs:
using: "composite"
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- run: read_catalog.sh . ${{ inputs.include }} > _sidebar.md
shell: bash
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add _sidebar.md
status=$(git status --porcelain)
if [ -z "$status" ]; then
echo "There are changes"
else
git commit -m "Add changes"
fi
shell: bash
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ inputs.github_token }}
branch: ${{ github.ref }}
branding:
icon: 'bookmark'
color: 'green'