-
Notifications
You must be signed in to change notification settings - Fork 243
55 lines (47 loc) · 1.28 KB
/
update-release-list.yaml
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
name: Update Release List
on:
release:
types: [published]
#workflow_run:
# workflows: ["Build Vim"]
# branches: [master]
# types: [completed]
permissions:
contents: write # to update wiki
env:
# Account for committing
USER_NAME: "vim-win32-installer CI"
USER_EMAIL: "[email protected]"
# Escape sequences
COL_RED: "\x1b[31m"
COL_GREEN: "\x1b[32m"
COL_YELLOW: "\x1b[33m"
COL_RESET: "\x1b[m"
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: main
- uses: actions/checkout@v4
with:
repository: "${{ github.repository }}.wiki"
path: wiki
- name: Update Release List
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd main
latest=$(sed -e 's/\[\([0-9]*\.[0-9]*\.[0-9]*\)\].*/|\1/' -e 's/.*|//' gitlog.txt)
cd ../wiki
../main/scripts/update-release-list.py
git add Releases-in-*.md
if git diff HEAD --quiet; then
echo ${COL_YELLOW}No updates.${COL_RESET}
else
git config --local user.name ${USER_NAME}
git config --local user.email ${USER_EMAIL}
git commit -a -m "Update Release List to ${latest}"
git push origin HEAD
fi