-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (43 loc) · 1.71 KB
/
wiki.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
name: Regenerate README.md
on:
gollum:
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Check out repository wiki
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}.wiki
path: wiki
- name: Prepare ENV variables
run: |
echo "VALID=$(cat wiki/env | grep ^VALID | cut -d= -f2)" >> $GITHUB_ENV
echo "INVALID=$(cat wiki/env | grep INVALID | cut -d= -f2)" >> $GITHUB_ENV
echo "DEPRECATED=$(cat wiki/env | grep DEPRECATED | cut -d= -f2)" >> $GITHUB_ENV
echo "CHECKNEEDED=$(cat wiki/env | grep CHECKNEEDED | cut -d= -f2)" >> $GITHUB_ENV
echo "READYTOCOMMIT=$(cat wiki/env | grep READYTOCOMMIT | cut -d= -f2)" >> $GITHUB_ENV
echo "UNKNOWN=$(cat wiki/env | grep UNKNOWN | cut -d= -f2)" >> $GITHUB_ENV
echo "LASTMOD=$(date)" >> $GITHUB_ENV
- name: Render README.md
uses: vafinvr/template-env-action@master
env:
VALID: ${{ env.VALID }}
INVALID: ${{ env.INVALID }}
DEPRECATED: ${{ env.DEPRECATED }}
CHECKNEEDED: ${{ env.CHECKNEEDED }}
READYTOCOMMIT: ${{ env.READYTOCOMMIT }}
UNKNOWN: ${{ env.UNKNOWN }}
LASTMOD: ${{ env.LASTMOD }}
with:
filename: TEMPLATE.md
- name: Commit changes to README.md
run: |
cp -p TEMPLATE.md README.md
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git diff-index --quiet HEAD || git commit -m "Update statistic numbers" && git push