-
Notifications
You must be signed in to change notification settings - Fork 71
42 lines (35 loc) · 1.24 KB
/
update-canary.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
name: Update canary branch
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
updateCanary:
name: Update the canary branch
if: github.repository == 'nodejs/node-v8' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Clone node-v8
uses: actions/checkout@v3
with:
path: node-v8
token: ${{ secrets.CANARY_UPDATE }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g node-core-utils@latest
- name: Cache V8 clone
uses: actions/cache@v3
with:
path: v8
key: v8-clone
- name: Execute the update script
run: ./node-v8/tools/update-canary.sh
- name: Notify Slack on failure
if: ${{ failure() }}
run: |
ACTIONS_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true"
SLACK_PAYLOAD="{\"username\": \"canary_bot\", \"text\": \"*Canary update failed!*\n\nRun: ${ACTIONS_URL}\", \"icon_emoji\": \":bell:\"}"
curl -X POST --data-urlencode "payload=${SLACK_PAYLOAD}" ${{ secrets.SLACK_WEBHOOK }}