Skip to content

Commit

Permalink
♻️ Use owner/repo from GitHub env
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 5, 2020
1 parent 317b20b commit 9882f48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { UpptimeConfig } from "./interfaces";

export const generateSummary = async () => {
const config = safeLoad(await readFile(join(".", ".upptimerc.yml"), "utf8")) as UpptimeConfig;
const owner = config.owner;
const repo = config.repo;
let [owner, repo] = (process.env.GITHUB_REPOSITORY || "").split("/");

const octokit = new Octokit({
auth: config.PAT || process.env.GH_PAT || process.env.GITHUB_TOKEN,
Expand Down
3 changes: 1 addition & 2 deletions src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import { generateSummary } from "./summary";

export const update = async (shouldCommit = false) => {
const config = safeLoad(await readFile(join(".", ".upptimerc.yml"), "utf8")) as UpptimeConfig;
const owner = config.owner;
const repo = config.repo;
let [owner, repo] = (process.env.GITHUB_REPOSITORY || "").split("/");

const octokit = new Octokit({
auth: config.PAT || process.env.GH_PAT || process.env.GITHUB_TOKEN,
Expand Down

0 comments on commit 9882f48

Please sign in to comment.