This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (52 loc) · 1.69 KB
/
generate.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
50
51
52
53
54
55
56
name: Generate vim syntax ex
on:
push:
branches:
- generator
workflow_dispatch:
schedule:
- cron: '36 20 * * Sat'
# workflow_dispatch and schedule : work under master branch
# push - branches - generator : work under generator branch
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master
- name: Checkout generator
uses: actions/checkout@v2
with:
ref: generator
path: generator
submodules: false
# submodule need manual update: vim/vim is huge
- name: Generate new syntax
run: |
cd generator
git submodule update --init --recursive --recommend-shallow --depth 1
make REVISION="$(date +%Y-%m-%dT%H:%M:%S%:z) $(git log -1 --format=%h)"
make test
cd ..
cp -f generator/vim.vim syntax/vim.vim
rm -rf generator
- name: Commit updated master branch
uses: EndBug/add-and-commit@v7
with:
default_author: github_actions
message: |-
Generated by GitHub workflow ${{ github.run_id }}
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
add: 'syntax/vim.vim'
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Use below statement when check diff.
# if: steps.changes.outputs.count > 0
# but always diff exists, because inserted time strings are different
# - name: Check changes
# id: changes
# run: |
# echo "::set-output name=count::$(git diff --name-only | wc -l)"