Skip to content

Commit 634cc6d

Browse files
committed
Generate MOTD file from JSON
1 parent f017f73 commit 634cc6d

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/generate-motd.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Generate motd for Linux OS"
2+
on:
3+
push:
4+
repository_dispatch:
5+
types: ["MOTD update"]
6+
7+
concurrency:
8+
group: redirector
9+
cancel-in-progress: false
10+
11+
jobs:
12+
jira:
13+
runs-on: ubuntu-24.04
14+
name: "Get from Armbian Jira"
15+
steps:
16+
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
path: armbian.github.io
22+
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
repository: "armbian/os"
27+
ref: motd
28+
fetch-depth: 0
29+
path: os
30+
31+
- name: "Generate file"
32+
run: |
33+
34+
cat os/motd.json | jq '.[] | .expiration,.message,.url' | xargs -n3 -d'\n' | sed -e 's/" "/|/' | sed "s/\"//g" > quotes.txt
35+
36+
- name: Commit changes if any
37+
run: |
38+
cd armbian.github.io
39+
git checkout data
40+
mkdir -p data/
41+
mv ${{ github.workspace }}/quotes.txt data/
42+
git config --global user.name "github-actions"
43+
git config --global user.email "[email protected]"
44+
git add data/.
45+
git diff --cached --quiet || git commit -m "Update WEB indes files"
46+
git push
47+
48+
# - name: "Run base-files update action"
49+
# uses: peter-evans/repository-dispatch@v3
50+
# with:
51+
# token: ${{ secrets.GITHUB_TOKEN }}
52+
# event-type: "Base files"

0 commit comments

Comments
 (0)