-
Notifications
You must be signed in to change notification settings - Fork 28
48 lines (39 loc) · 1.15 KB
/
actions.yml
File metadata and controls
48 lines (39 loc) · 1.15 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
42
43
44
45
46
47
48
name: Medium Writeups
on:
schedule:
- cron: '*/10 * * * *'
push:
branches:
- main
# Actions project permission
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.4' # Specify the version of Go you want to use
- name: Scraping Medium Writeups
run: |
go run main.go | tee NEW-README.md
- name: Deleting old README.md and rename NEW-README.md
run: |
rm -rf README.md && mv NEW-README.md README.md
- name: Commit and push changes if there are any
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@users.noreply.github.com'
git add .
# Check if there are changes before committing
if ! git diff --cached --exit-code; then
IST_DATE=$(TZ='Asia/Kolkata' date +'%a %b %d %H:%M:%S IST %Y')
git commit -m "Updated List: $IST_DATE"
git push
else
echo "No changes to commit"
fi