-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (49 loc) · 1.63 KB
/
check-sales.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
49
50
51
52
name: Check for New Lost Robbie Sales
on:
push:
branches:
- master
schedule:
- cron: "0 0 * * *"
jobs:
check-lost-robbie-sales:
runs-on: ubuntu-latest
steps:
- uses: szenius/set-timezone@v1.0
with:
timezoneLinux: 'America/New_York'
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Update with new offers or sales
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
timeout-minutes: 5
run: |
npm install
npm run update
npm run sales
npm run log
echo PR_TITLE=$(git diff --unified=0 README.md | tail -n +5 | grep '|' | head -n 1 | cut -d'+' -f2 | awk -F ' on ' '{print $1}') >> $GITHUB_ENV
echo PR_BODY=$(git diff --unified=0 README.md | tail -n +5 | grep '^\+' | cut -d'+' -f2 | awk -F ' on ' '{print $1}') >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: |
Updated with new offers or sales.
${{ env.PR_TITLE }}
delete-branch: true
title: |
Updated: ${{ env.PR_TITLE }}
body: |
Updated with new offers or sales.
```
${{ env.PR_BODY }}
```
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"