-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.13 KB
/
toc.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
name: Generate TOC
on:
- push
- pull_request
jobs:
test:
name: Generate TOC and check if we need to create a PR
runs-on: ubuntu-latest
env:
CI_COMMIT_MESSAGE: Update TOC
CI_COMMIT_AUTHOR: TOC generator
timeout-minutes: 5
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 14
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build commands
run: node TOC.js > README.md
- name: Check git diff
run: git diff --exit-code README.md
id: git-diff
continue-on-error: true
- name: GIT Commit Build Artifacts (coverage, dist, devdist, docs)
if: github.event_name == 'push' && steps.git-diff.outcome == 'failure' && steps.git-diff.conclusion == 'success'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "eiriksm@users.noreply.github.com"
git add README.md
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push