-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.44 KB
/
cron.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
38
39
40
41
42
43
44
45
46
47
48
name: Finds twingos every 30 minutes
on:
workflow_dispatch:
schedule:
- cron: "*/30 * * * *" # This cron expression runs every 30 minutes
jobs:
find-twingos:
runs-on: ubuntu-latest
steps:
- name: Twingo needs the repository
uses: actions/checkout@v3
- name: Twingo requires Node
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Twingo requires packages
run: npm install
- name: Scraping twingos...
id: scraping-twingos
run: |
OUTPUT=$(node index.js)
echo "scraping_result=$OUTPUT" >> $GITHUB_OUTPUT
- name: New twingos were found! Sending email...
if: ${{ steps.scraping-twingos.outputs.scraping_result == 1 }}
uses: dawidd6/action-send-mail@v4
with:
server_address: ${{ vars.MAIL_SERVER_ADDRESS }}
server_port: ${{ vars.MAIL_SERVER_PORT }}
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: New Twingos found!
to: ${{ vars.MAIL_TO }}
from: Twingo Finder
html_body: file://twingos-email.html
- name: Pushing twingos (possible updates of twingos-email.html and twingos.json)
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Pushing twingos"
commit_user_name: "GitHub Action"
commit_user_email: "[email protected]"