@@ -15,35 +15,35 @@ jobs:
1515
1616 - name : Generate wiki change message
1717 run : |
18- actor="${{ github.actor }}"
19- sender_url=$(jq -r '.sender.html_url' "$GITHUB_EVENT_PATH")
20- page_name=$(jq -r '.pages[0].page_name' "$GITHUB_EVENT_PATH")
21- page_sha=$(jq -r '.pages[0].sha' "$GITHUB_EVENT_PATH")
22- page_url=$(jq -r '.pages[0].html_url' "$GITHUB_EVENT_PATH")
23- page_action=$(jq -r '.pages[0].action' "$GITHUB_EVENT_PATH")
24- now="$(date '+%Y-%m-%d %H:%M:%S')"
25-
26- cd wiki
27- prev_sha=$(git rev-list $page_sha^ -- "$page_name.md" | head -n 1)
28- if [ -n "$prev_sha" ]; then
29- git diff $prev_sha $page_sha -- "$page_name.md" > ../wiki.diff || echo "(No diff found)" > ../wiki.diff
30- else
31- echo "(no diff)" > ../wiki.diff
32- fi
33- cd ..
34- {
35- echo "Wiki edited"
36- echo -n "User : "
37- echo " [$actor]($sender_url)"
38- echo "Time : $now"
39- echo "Page : [$page_name]($page_url) (Action: $page_action)"
40- echo ""
41- echo "----"
42- echo "### diff:"
43- echo '```diff'
44- cat wiki.diff
45- echo '```'
46- } > wiki-change-msg.txt
18+ actor="${{ github.actor }}"
19+ sender_url=$(jq -r '.sender.html_url' "$GITHUB_EVENT_PATH")
20+ page_name=$(jq -r '.pages[0].page_name' "$GITHUB_EVENT_PATH")
21+ page_sha=$(jq -r '.pages[0].sha' "$GITHUB_EVENT_PATH")
22+ page_url=$(jq -r '.pages[0].html_url' "$GITHUB_EVENT_PATH")
23+ page_action=$(jq -r '.pages[0].action' "$GITHUB_EVENT_PATH")
24+ now="$(date '+%Y-%m-%d %H:%M:%S')"
25+
26+ cd wiki
27+ prev_sha=$(git rev-list $page_sha^ -- "$page_name.md" | head -n 1)
28+ if [ -n "$prev_sha" ]; then
29+ git diff $prev_sha $page_sha -- "$page_name.md" > ../wiki.diff || echo "(No diff found)" > ../wiki.diff
30+ else
31+ echo "(no diff)" > ../wiki.diff
32+ fi
33+ cd ..
34+ {
35+ echo "Wiki edited"
36+ echo -n "User: "
37+ echo "[$actor]($sender_url)"
38+ echo "Time: $now"
39+ echo "Page: [$page_name]($page_url) (Action: $page_action)"
40+ echo ""
41+ echo "----"
42+ echo "### diff:"
43+ echo '```diff'
44+ cat wiki.diff
45+ echo '```'
46+ } > wiki-change-msg.txt
4747
4848 - name : Create issue to notify Neilpang
4949 uses : peter-evans/create-issue-from-file@v5
0 commit comments