Skip to content

Commit

Permalink
♻️ Use default GITHUB_TOKEN in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Mar 3, 2021
1 parent 87dd32c commit cde5e47
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/helpers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getConfig } from "./config";
export const getOctokit = async (): Promise<Octokit> => {
const config = await getConfig();
return new Octokit({
auth: config.PAT || process.env.GH_PAT || process.env.GITHUB_TOKEN,
auth: config.PAT || process.env.GITHUB_TOKEN,
userAgent: config["user-agent"] || process.env.USER_AGENT || "KojBot",
});
};
46 changes: 23 additions & 23 deletions src/helpers/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Generate graphs
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "graphs"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
`;
};

Expand All @@ -87,13 +87,13 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Update response time
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "response-time"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
SECRETS_CONTEXT: \${{ toJson(secrets) }}
`;
};
Expand Down Expand Up @@ -122,41 +122,41 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Update template
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "update-template"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- name: Update response time
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "response-time"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
SECRETS_CONTEXT: \${{ toJson(secrets) }}
- name: Update summary in README
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "readme"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- name: Generate graphs
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Graphs CI
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Generate site
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "site"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- uses: peaceiris/actions-gh-pages@v3.7.3
name: GitHub Pages Deploy
with:
github_token: \${{ secrets.GH_PAT }}
github_token: \${{ secrets.GITHUB_TOKEN }}
publish_dir: "site/status-page/__sapper__/export/"
user_name: "${commitMessages.commitAuthorName || "Upptime Bot"}"
user_email: "${
Expand Down Expand Up @@ -189,17 +189,17 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Generate site
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "site"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- uses: peaceiris/actions-gh-pages@v3.7.3
name: GitHub Pages Deploy
with:
github_token: \${{ secrets.GH_PAT }}
github_token: \${{ secrets.GITHUB_TOKEN }}
publish_dir: "site/status-page/__sapper__/export/"
user_name: "${commitMessages.commitAuthorName || "Upptime Bot"}"
user_email: "${
Expand Down Expand Up @@ -230,17 +230,17 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Update summary in README
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "readme"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- name: Run readme-repos-list
uses: koj-co/readme-repos-list@master
with:
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
query: "topic:upptime"
size: 20
max: 1000
Expand Down Expand Up @@ -270,13 +270,13 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Update template
uses: upptime/uptime-monitor@master
with:
command: "update-template"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
`;
};

Expand All @@ -302,11 +302,11 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Update code
uses: upptime/updates@master
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
`;
};

Expand All @@ -332,13 +332,13 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: \${{ github.head_ref }}
token: \${{ secrets.GH_PAT }}
token: \${{ secrets.GITHUB_TOKEN }}
- name: Check endpoint status
uses: upptime/uptime-monitor@${await getUptimeMonitorVersion()}
with:
command: "update"
env:
GH_PAT: \${{ secrets.GH_PAT }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
SECRETS_CONTEXT: \${{ toJson(secrets) }}
`;
};
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { generateSummary } from "./summary";
import { update } from "./update";
import { updateTemplate } from "./update-template";

const token = getInput("token") || process.env.GH_PAT || process.env.GITHUB_TOKEN;
const token = getInput("token") || process.env.GITHUB_TOKEN;
const SECRETS_CONTEXT = process.env.SECRETS_CONTEXT || "{}";
const allSecrets: Record<string, string> = JSON.parse(SECRETS_CONTEXT);
Object.keys(allSecrets).forEach((key) => {
Expand Down
4 changes: 2 additions & 2 deletions src/workflows/graphs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate graphs
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "graphs"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions src/workflows/response-time.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update response time
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "response-time"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}
14 changes: 7 additions & 7 deletions src/workflows/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update template
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "update-template"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update response time
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "response-time"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}
- name: Update summary in README
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "readme"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate graphs
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Graphs CI
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate site
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "site"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: maxheld83/ghpages@v0.3.0
name: GitHub Pages Deploy
env:
BUILD_DIR: "site/status-page/__sapper__/export/"
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions src/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate site
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "site"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: maxheld83/ghpages@v0.3.0
name: GitHub Pages Deploy
env:
BUILD_DIR: "site/status-page/__sapper__/export/"
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions src/workflows/summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update summary in README
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "readme"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run readme-repos-list
uses: koj-co/readme-repos-list@master
with:
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
query: "topic:upptime"
size: 15
max: 1000
Expand Down
4 changes: 2 additions & 2 deletions src/workflows/update-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update template
uses: upptime/uptime-monitor@master
with:
command: "update-template"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions src/workflows/updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update code
uses: upptime/updates@master
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions src/workflows/uptime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
uses: actions/checkout@v2.3.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check endpoint status
uses: upptime/uptime-monitor@UPTIME_MONITOR_VERSION
with:
command: "update"
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}

0 comments on commit cde5e47

Please sign in to comment.