-
-
Notifications
You must be signed in to change notification settings - Fork 48
49 lines (39 loc) · 1.26 KB
/
readme.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: readme
on:
push:
branches: master
paths:
- docs/**
- colophon.yml
- .github/workflows/readme.yml
jobs:
readme:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker://pandoc/core:2.9
with:
args: >-
--metadata-file=colophon.yml
--template=docs/README.template
--output=README.md
--from=markdown_github+yaml_metadata_block
--to=gfm
--fail-if-warnings
--wrap=preserve
docs/README.md
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GH_TOKEN}}
script: |
const { readFileSync } = require('fs')
const path = 'README.md'
const content = readFileSync(`${process.env.GITHUB_WORKSPACE}/${path}`)
const { data } = await github.repos.getContent({ ...context.repo, path })
if (Buffer.from(data.content, 'base64').compare(content) === 0) return
await github.repos.createOrUpdateFileContents({...context.repo, path,
sha: data.sha,
message: 'docs(readme): update readme',
content: content.toString('base64')
})