-
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.74 KB
/
Copy pathRefreshSubmodulesCommitID.yml
File metadata and controls
41 lines (38 loc) · 1.74 KB
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
# Actions タブで過去の CI 実行を確認する為のフィルタ用のワークフローファイル
name: "Refresh Submodules Commit ID"
on:
push:
branches: [ "gh-pages" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: "Recreate submodules commit ID list file."
run: |
rm -f _includes/submod_hashes.html
touch _includes/submod_hashes.html
- name: "Print submodules commit IDs."
run: git submodule status
- name: "Fetch submodules commit IDs."
run: |
git submodule status | while read line; do
if [ "${line}" ]; then
#commit_id=$(echo ${line} | sed -e 's/^\s*\([0-9A-Za-z]\+\)\s\+\([0-9A-Za-z/_-]\+\)\s\+([0-9A-Za-z/_-]\+)\s*$/\1/g')
#submoddir=$(echo ${line} | sed -e 's/^\s*\([0-9A-Za-z]\+\)\s\+\([0-9A-Za-z/_-]\+\)\s\+([0-9A-Za-z/_-]\+)\s*$/\2/g')
commit_id=$(echo ${line} | sed -e 's/^-\([0-9A-Za-z]\+\)\s\+\([0-9A-Za-z/_-]\+\)\s*$/\1/g')
submoddir=$(echo ${line} | sed -e 's/^-\([0-9A-Za-z]\+\)\s\+\([0-9A-Za-z/_-]\+\)\s*$/\2/g')
submoddir=$(echo ${submoddir} | sed -e 's/[^0-9A-Za-z_]/_/g')
echo {% assign commit_id_for_${submoddir}=\"${commit_id}\" %}>>_includes/submod_hashes.html
fi
done
- name: "Configure git user information."
run: |
git config --local user.email "noreply@localhost"
git config --local user.name "[BOT] Refresh Submodules Commit ID"
- name: "Commit & Push"
run: |
git add .
git commit -m "Update _includes/submod_hashes.html" || exit $(($? - 1))
git push