Skip to content

Commit

Permalink
chore(template): sync with ahmadnassri/template-node-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Mar 4, 2021
1 parent 2cba038 commit 192eff2
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# ----------------------------------------------------------- #
# Note: this file originates in ahmadnassri/template-template #
# ----------------------------------------------------------- #

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.11.4
with:
args: >-
--metadata-file=colophon.yml
--template=docs/README.template
--output=README.md
--from=gfm
--to=gfm
--fail-if-warnings
--wrap=preserve
--reference-links
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')
})

0 comments on commit 192eff2

Please sign in to comment.