Skip to content

Commit 20463f6

Browse files
authoredAug 5, 2020
fix: Theme preview script (anuraghazra#318)
* chore: testing theme preview script * fix: workflow * test current pr * comment on pr script * fix: preview theme script * fix: preview theme * fix: token fix * test: theme * fix: conflict
1 parent ce8660c commit 20463f6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
 

‎.github/workflows/preview-theme.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
branches:
77
- master
88
- theme-preview-script
9-
paths:
109
- "themes/index.js"
1110

1211
jobs:
@@ -27,3 +26,5 @@ jobs:
2726
env:
2827
CI: true
2928
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}

‎scripts/preview-theme.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const parsePullRequestId = (githubRef) => {
1515

1616
async function run() {
1717
try {
18-
const octokit = github.getOctokit(process.env.PERSONAL_TOKEN);
18+
const token = core.getInput("token");
19+
const octokit = github.getOctokit(token || process.env.PERSONAL_TOKEN);
1920
const pullRequestId = parsePullRequestId(process.env.GITHUB_REF);
2021

2122
let res = await octokit.pulls.get({

‎themes/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ const themes = {
113113
text_color: "0cf574",
114114
bg_color: "040f0f",
115115
},
116-
"algolia": {
116+
algolia: {
117117
title_color: "00AEFF",
118118
icon_color: "2DDE98",
119119
text_color: "FFFFFF",
120120
bg_color: "050F2C",
121121
},
122-
"great-gatsby":{
122+
"great-gatsby": {
123123
title_color: "ffa726",
124124
icon_color: "ffb74d",
125125
text_color: "ffd95b",
126126
bg_color: "000000",
127127
},
128-
"bear": {
128+
bear: {
129129
title_color: "e03c8a",
130130
icon_color: "00AEFF",
131131
text_color: "bcb28d",

0 commit comments

Comments
 (0)
Please sign in to comment.