diff --git a/.eslintrc.js b/.eslintrc.js index ecedee734d6..b7e41fed1fb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,6 +46,7 @@ module.exports = { 'no-negated-condition': 2, 'no-nested-ternary': 2, 'no-plusplus': [2, { allowForLoopAfterthoughts: true }], + 'no-underscore-dangle': [2, { enforceInMethodNames: true }], 'no-unreachable-loop': 2, 'no-useless-backreference': 2, 'no-useless-computed-key': [2, { enforceForClassMembers: true }], diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90bd103ee62..c5ed29a3eff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,4 +35,4 @@ jobs: # We set a flag so we can skip tests that access Netlify API NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }} - _NETLIFY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NETLIFY_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/commands/functions/invoke.js b/src/commands/functions/invoke.js index bca4cb84cbe..691d810500c 100644 --- a/src/commands/functions/invoke.js +++ b/src/commands/functions/invoke.js @@ -88,7 +88,7 @@ class FunctionsInvokeCommand extends Command { } } else { // NOT an event triggered function, but may still want to simulate authentication locally - let _isAuthed = false + let isAuthenticated = false if (typeof flags.identity === 'undefined') { const { isAuthed } = await inquirer.prompt([ { @@ -98,11 +98,11 @@ class FunctionsInvokeCommand extends Command { default: true, }, ]) - _isAuthed = isAuthed + isAuthenticated = isAuthed } else { - _isAuthed = flags.identity + isAuthenticated = flags.identity } - if (_isAuthed) { + if (isAuthenticated) { headers = { authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb3VyY2UiOiJuZXRsaWZ5IGZ1bmN0aW9uczp0cmlnZ2VyIiwidGVzdERhdGEiOiJORVRMSUZZX0RFVl9MT0NBTExZX0VNVUxBVEVEX0pXVCJ9.Xb6vOFrfLUZmyUkXBbCvU4bM7q8tPilF0F03Wupap_c', diff --git a/src/lib/exec-fetcher.js b/src/lib/exec-fetcher.js index 9882b8a2a38..ecf9e1ca1e5 100644 --- a/src/lib/exec-fetcher.js +++ b/src/lib/exec-fetcher.js @@ -18,9 +18,9 @@ const getExecName = ({ execName }) => { const getOptions = () => { // this is used in out CI tests to avoid hitting GitHub API limit // when calling gh-release-fetch - if (process.env._NETLIFY_GITHUB_TOKEN) { + if (process.env.NETLIFY_TEST_GITHUB_TOKEN) { return { - headers: { Authorization: `token ${process.env._NETLIFY_GITHUB_TOKEN}` }, + headers: { Authorization: `token ${process.env.NETLIFY_TEST_GITHUB_TOKEN}` }, } } }