Skip to content

Commit

Permalink
✨ Add support for IPv6 via WARP
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jan 8, 2024
1 parent eb5f383 commit e328be7
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/helpers/workflows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getOctokit } from "./github";
import { getConfig } from "./config";
import {
DEFAULT_RUNNER,
Expand All @@ -10,6 +9,7 @@ import {
UPDATES_CI_SCHEDULE,
UPTIME_CI_SCHEDULE,
} from "./constants";
import { getOctokit } from "./github";

let release: string | undefined = undefined;
export const getUptimeMonitorVersion = async () => {
Expand All @@ -24,8 +24,7 @@ export const getUptimeMonitorVersion = async () => {
return release;
};

const introComment =
async () => `# This file was generated by upptime/uptime-monitor@${await getUptimeMonitorVersion()}
const introComment = async () => `# This file was generated by upptime/uptime-monitor@${await getUptimeMonitorVersion()}
#
# ===============================
# Do not edit this file directly!
Expand Down Expand Up @@ -66,6 +65,11 @@ jobs:
`;
};

const getHasIpV6Site = async (): Promise<boolean> => {
const config = await getConfig();
return !!config.sites.find((site) => site.ipv6);
};

export const responseTimeCiWorkflow = async () => {
const config = await getConfig();
const workflowSchedule = config.workflowSchedule || {};
Expand All @@ -88,7 +92,13 @@ jobs:
uses: actions/checkout@v3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT || github.token }}
token: \${{ secrets.GH_PAT || github.token }}${
(await getHasIpV6Site())
? `
- name: Setup WARP

This comment has been minimized.

Copy link
@titanism

titanism Jan 9, 2024

Contributor

@AnandChowdhary indentation is off here by a few spaces, see upptime/upptime#904. I believe this off by 4 spaces.

uses: fscarmen/warp-on-actions@v2`
: ""
}
- name: Update response time
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
Expand All @@ -101,7 +111,6 @@ jobs:

export const setupCiWorkflow = async () => {
const config = await getConfig();
const workflowSchedule = config.workflowSchedule || {};
const commitMessages = config.commitMessages || {};
const statusWebsite = config["status-website"] || {};

Expand Down Expand Up @@ -130,7 +139,13 @@ jobs:
with:
command: "update-template"
env:
GH_PAT: \${{ secrets.GH_PAT || github.token }}
GH_PAT: \${{ secrets.GH_PAT || github.token }}${
(await getHasIpV6Site())
? `
- name: Setup WARP
uses: fscarmen/warp-on-actions@v2`
: ""
}
- name: Update response time
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
Expand Down

0 comments on commit e328be7

Please sign in to comment.