From 20463f63657e39d2529abc2350b60a8ef504d674 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Wed, 5 Aug 2020 21:57:11 +0530 Subject: [PATCH] fix: Theme preview script (#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 --- .github/workflows/preview-theme.yml | 3 ++- scripts/preview-theme.js | 3 ++- themes/index.js | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml index c0203c3..44782ee 100644 --- a/.github/workflows/preview-theme.yml +++ b/.github/workflows/preview-theme.yml @@ -6,7 +6,6 @@ on: branches: - master - theme-preview-script - paths: - "themes/index.js" jobs: @@ -27,3 +26,5 @@ jobs: env: CI: true PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/preview-theme.js b/scripts/preview-theme.js index 6a0eaa6..4935b77 100644 --- a/scripts/preview-theme.js +++ b/scripts/preview-theme.js @@ -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({ diff --git a/themes/index.js b/themes/index.js index 56ff998..8dda8f8 100644 --- a/themes/index.js +++ b/themes/index.js @@ -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",