1
- import { getOctokit } from "./github" ;
2
1
import { getConfig } from "./config" ;
3
2
import {
4
3
DEFAULT_RUNNER ,
@@ -10,6 +9,7 @@ import {
10
9
UPDATES_CI_SCHEDULE ,
11
10
UPTIME_CI_SCHEDULE ,
12
11
} from "./constants" ;
12
+ import { getOctokit } from "./github" ;
13
13
14
14
let release : string | undefined = undefined ;
15
15
export const getUptimeMonitorVersion = async ( ) => {
@@ -24,8 +24,7 @@ export const getUptimeMonitorVersion = async () => {
24
24
return release ;
25
25
} ;
26
26
27
- const introComment =
28
- async ( ) => `# This file was generated by upptime/uptime-monitor@${ await getUptimeMonitorVersion ( ) }
27
+ const introComment = async ( ) => `# This file was generated by upptime/uptime-monitor@${ await getUptimeMonitorVersion ( ) }
29
28
#
30
29
# ===============================
31
30
# Do not edit this file directly!
66
65
` ;
67
66
} ;
68
67
68
+ const getHasIpV6Site = async ( ) : Promise < boolean > => {
69
+ const config = await getConfig ( ) ;
70
+ return ! ! config . sites . find ( ( site ) => site . ipv6 ) ;
71
+ } ;
72
+
69
73
export const responseTimeCiWorkflow = async ( ) => {
70
74
const config = await getConfig ( ) ;
71
75
const workflowSchedule = config . workflowSchedule || { } ;
88
92
uses: actions/checkout@v3
89
93
with:
90
94
ref: \${{ github.head_ref }}
91
- token: \${{ secrets.GH_PAT || github.token }}
95
+ token: \${{ secrets.GH_PAT || github.token }}${
96
+ ( await getHasIpV6Site ( ) )
97
+ ? `
98
+ - name: Setup WARP
99
+ uses: fscarmen/warp-on-actions@v2`
100
+ : ""
101
+ }
92
102
- name: Update response time
93
103
uses: upptime/uptime-monitor@${ await getUptimeMonitorVersion ( ) }
94
104
with:
@@ -101,7 +111,6 @@ jobs:
101
111
102
112
export const setupCiWorkflow = async ( ) => {
103
113
const config = await getConfig ( ) ;
104
- const workflowSchedule = config . workflowSchedule || { } ;
105
114
const commitMessages = config . commitMessages || { } ;
106
115
const statusWebsite = config [ "status-website" ] || { } ;
107
116
@@ -130,7 +139,13 @@ jobs:
130
139
with:
131
140
command: "update-template"
132
141
env:
133
- GH_PAT: \${{ secrets.GH_PAT || github.token }}
142
+ GH_PAT: \${{ secrets.GH_PAT || github.token }}${
143
+ ( await getHasIpV6Site ( ) )
144
+ ? `
145
+ - name: Setup WARP
146
+ uses: fscarmen/warp-on-actions@v2`
147
+ : ""
148
+ }
134
149
- name: Update response time
135
150
uses: upptime/uptime-monitor@${ await getUptimeMonitorVersion ( ) }
136
151
with:
0 commit comments