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 anthony-redFox committed May 5, 2023
1 parent f0daadb commit 8ebfa85
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 8ebfa85

Please sign in to comment.