1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Move test & script utils out of /lib (#17517)

* Remove an unused file

* Move authenticate-to-aws to scripts/utils

* Move crowdin-config to tests/utils

* Remove add-frontmatter-to-file

* Move find-unused-assets

* Move git-utils to script/utils

* Move lib/github to script/utils

* Revert "Remove an unused file"

This reverts commit cd93ad846a0354e957359f23124eb0724c9147cf.

* Move find-extraneous-translation-files to script/utils

* We already have tests/helpers

* Rename script/utils => helpers for consistency

* Forgot a path

* Fix path to crowdin-config

Co-authored-by: Chiedo John <2156688+chiedo@users.noreply.github.com>
This commit is contained in:
Jason Etcovitch
2021-01-29 10:30:51 -05:00
committed by GitHub
parent 0e04893e4a
commit 8d4f3e65fe
16 changed files with 16 additions and 24 deletions

18
script/helpers/github.js Normal file
View File

@@ -0,0 +1,18 @@
if (!process.env.GITHUB_TOKEN) {
require('dotenv').config()
}
// this module needs to work in development, production, and GitHub Actions
//
// GITHUB_TOKEN comes from one of the following sources:
// 1. set in the .env file (development)
// 2. set as a Heroku config var (staging and production)
// 3. an installation token granted via GitHub Actions
const apiToken = process.env.GITHUB_TOKEN
// See https://github.com/octokit/rest.js/issues/1207
module.exports = function github () {
return require('@octokit/rest')({
auth: `token ${apiToken}`
})
}