-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.09 KB
/
banner.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
name: WIP Banner
on:
push:
branches:
- main # or master before October 2020
jobs:
github-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get last commit message
id: gitlog
run: |
message=$(git log --format=%s -n 1 HEAD)
message="${message//'%'/'%25'}"
message="${message//$'\n'/'%0A'}"
message="${message//$'\r'/'%0D'}"
echo "message=$message" >> "$GITHUB_ENV"
- name: Get last commit date
id: gitdate
run: echo "date=$(git log -1 --format=%cd --date=format:'%Y-%m-%d')" >> "$GITHUB_ENV"
- name: Write to banner.yml
run: |
echo "message: \"$message\"" > ./_data/banner.yml
echo "date: \"$date\"" >> ./_data/banner.yml
- name: Commit banner.yml
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add ./_data/banner.yml
git commit -m "Update banner.yml with last commit message and date [skip ci]"
git push