Skip to content

Commit

Permalink
feat: add singleCommit option which allows making publish branch wi…
Browse files Browse the repository at this point in the history
…th only the latest commit (#208)

discussion at <upptime/upptime#713>
  • Loading branch information
liblaf committed Jan 23, 2023
1 parent 2314e3b commit 1dfc28f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/helpers/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ 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 @@ -102,6 +103,7 @@ export const setupCiWorkflow = async () => {
const config = await getConfig();
const workflowSchedule = config.workflowSchedule || {};
const commitMessages = config.commitMessages || {};
const statusWebsite = config["status-website"] || {};

return `${await introComment()}
Expand Down Expand Up @@ -158,6 +160,7 @@ jobs:
with:
github_token: \${{ secrets.GH_PAT }}
publish_dir: "site/status-page/__sapper__/export/"
force_orphan: "${statusWebsite.singleCommit || false}"
user_name: "${commitMessages.commitAuthorName || "Upptime Bot"}"
user_email: "${
commitMessages.commitAuthorEmail || "73812536+upptime-bot@users.noreply.github.com"
Expand All @@ -169,6 +172,7 @@ export const siteCiWorkflow = async () => {
const config = await getConfig();
const workflowSchedule = config.workflowSchedule || {};
const commitMessages = config.commitMessages || {};
const statusWebsite = config["status-website"] || {};

return `${await introComment()}
Expand Down Expand Up @@ -201,6 +205,7 @@ jobs:
with:
github_token: \${{ secrets.GH_PAT }}
publish_dir: "site/status-page/__sapper__/export/"
force_orphan: "${statusWebsite.singleCommit || false}"
user_name: "${commitMessages.commitAuthorName || "Upptime Bot"}"
user_email: "${
commitMessages.commitAuthorEmail || "73812536+upptime-bot@users.noreply.github.com"
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface UpptimeConfig {
introMessage?: string;
navbar?: { title: string; url: string }[];
publish?: boolean;
singleCommit?: boolean;
};
skipDescriptionUpdate?: boolean;
skipTopicsUpdate?: boolean;
Expand Down

0 comments on commit 1dfc28f

Please sign in to comment.