Skip to content

Commit

Permalink
chore: add DOCS_GITHUB_TOKEN secret for updating karma documentation
Browse files Browse the repository at this point in the history
We have a script, which is run as part of release process to automatically
update the documentation website:
https://github.com/karma-runner/karma-runner.github.com. The DOCS_GITHUB_TOKEN
secret contains a GitHub token with write access to the website repository.
  • Loading branch information
devoto13 authored and Jonathan Ginsburg committed Oct 18, 2021
1 parent 4b3b072 commit ab9ebf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCS_GITHUB_TOKEN: ${{ secrets.DOCS_GITHUB_TOKEN }}
KARMA_TEST_NO_FALLBACK: 1
steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 5 additions & 4 deletions tools/update-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ const success = async (pluginConfig, { nextRelease, logger }) => {
const { name: docsPath } = dirSync()

// This is a regular repository remote one would get if they click a Clone
// button on GitHub. The only added part is GH_TOKEN value in the `userinfo`
// part of the URL (https://en.wikipedia.org/wiki/URL), which allows GitHub
// to authenticate a user and authorise the push to the repository.
const repoOrigin = `https://${process.env.GH_TOKEN}@github.com/karma-runner/karma-runner.github.com.git`
// button on GitHub. The only added part is DOCS_GITHUB_TOKEN value in the
// `userinfo` part of the URL (https://en.wikipedia.org/wiki/URL), which
// allows GitHub to authenticate a user and authorise the push to the
// repository.
const repoOrigin = `https://${process.env.DOCS_GITHUB_TOKEN}@github.com/karma-runner/karma-runner.github.com.git`

const options = { encoding: 'utf8', cwd: docsPath }

Expand Down

0 comments on commit ab9ebf8

Please sign in to comment.