Skip to content

Commit

Permalink
fix: Theme preview script (anuraghazra#318)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
anuraghazra authored Aug 5, 2020
1 parent ce8660c commit 20463f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/preview-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches:
- master
- theme-preview-script
paths:
- "themes/index.js"

jobs:
Expand All @@ -27,3 +26,5 @@ jobs:
env:
CI: true
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const parsePullRequestId = (githubRef) => {

async function run() {
try {
const octokit = github.getOctokit(process.env.PERSONAL_TOKEN);
const token = core.getInput("token");
const octokit = github.getOctokit(token || process.env.PERSONAL_TOKEN);
const pullRequestId = parsePullRequestId(process.env.GITHUB_REF);

let res = await octokit.pulls.get({
Expand Down
6 changes: 3 additions & 3 deletions themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ const themes = {
text_color: "0cf574",
bg_color: "040f0f",
},
"algolia": {
algolia: {
title_color: "00AEFF",
icon_color: "2DDE98",
text_color: "FFFFFF",
bg_color: "050F2C",
},
"great-gatsby":{
"great-gatsby": {
title_color: "ffa726",
icon_color: "ffb74d",
text_color: "ffd95b",
bg_color: "000000",
},
"bear": {
bear: {
title_color: "e03c8a",
icon_color: "00AEFF",
text_color: "bcb28d",
Expand Down

0 comments on commit 20463f6

Please sign in to comment.