Skip to content

Commit b02b872

Browse files
committed
feat: add workflow to get random Tale of Kieu
1 parent 9bcd204 commit b02b872

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: random-tale-of-kieu
2+
3+
on:
4+
# Run automatically everyday at 00:05
5+
# schedule:
6+
# - cron: "5 0 * * *"
7+
8+
# Allows to manually run the job at any time
9+
workflow_dispatch:
10+
# Run on every push or pull request on main branch
11+
push:
12+
branches: [ "main" ]
13+
14+
permissions:
15+
contents: write
16+
17+
# Only a single workflow in the same concurrency will run at the same time
18+
concurrency:
19+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
20+
cancel-in-progress: true
21+
22+
jobs:
23+
generate_wallpaper:
24+
name: Get the random sentence from The Tale of Kieu - Nguyen Du
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
# Checkout the main branch
29+
- uses: actions/checkout@v4
30+
31+
# Uses action in the root directory to get random Tale of Kieu
32+
- name: The random tale of Kieu
33+
uses: ./
34+
35+
# Push the random Tale of Kieu to main branch
36+
# Note: the following account information will not work on GHES
37+
- name: Push the random Tale of Kieu to main branch
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
41+
git add .
42+
git commit -m ":robot: The random Tale of Kieu [skip ci]"
43+
git push

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# random-tale-of-kieu
2-
Random from The Tale of Kieu - Nguyen Du
1+
# Get the random sentence from The Tale of Kieu - Nguyen Du
2+
3+
Random sentence from The Tale of Kieu - Nguyen Du
34

45
<div align="center">
56
<!-- START_POEM -->
File renamed without changes.
File renamed without changes.

assets/wallpaper.jpg

98.1 KB
Loading

src/random.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFile, writeFile } from 'node:fs/promises'
22
import { resolve } from 'node:path'
33
import * as core from '@actions/core'
4-
import { default as kieu } from './truyen-kieu-1871.json'
4+
import { default as kieu } from '../assets/truyen-kieu-1871.json'
55

66
interface doublePoem {
77
line: number

0 commit comments

Comments
 (0)