-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ const exec_1 = __nccwpck_require__(1514); | |
const axios_1 = __importDefault(__nccwpck_require__(6545)); | ||
const API_URL = 'https://api.devcycle.com/'; | ||
const AUTH_URL = 'https://auth.devcycle.com/'; | ||
const DVC_IDENTIFIER = 'github.code_usages'; | ||
function run() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const requiredInputs = ['github-token', 'project-key', 'client-id', 'client-secret']; | ||
|
@@ -62,8 +63,8 @@ function run() { | |
return; | ||
} | ||
try { | ||
yield (0, exec_1.exec)('npm', ['install', '-g', '@devcycle/[email protected].8']); | ||
const output = yield (0, exec_1.getExecOutput)('dvc', ['usages', '--format', 'json']); | ||
yield (0, exec_1.exec)('npm', ['install', '-g', '@devcycle/[email protected].10']); | ||
const output = yield (0, exec_1.getExecOutput)('dvc', ['usages', '--format', 'json', '--caller', DVC_IDENTIFIER]); | ||
const variables = JSON.parse(output.stdout); | ||
yield action.postCodeUsages(variables); | ||
} | ||
|
@@ -97,7 +98,8 @@ const postCodeUsages = (variables) => __awaiter(void 0, void 0, void 0, function | |
const authToken = yield action.authenticate(clientId, clientSecret); | ||
const url = new URL(`/v1/projects/${projectKey}/codeUsages`, API_URL); | ||
const headers = { | ||
Authorization: authToken | ||
Authorization: authToken, | ||
'dvc-referrer': DVC_IDENTIFIER | ||
}; | ||
const { owner, repo } = github.context.repo; | ||
try { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ import axios from 'axios' | |
const API_URL = 'https://api.devcycle.com/' | ||
const AUTH_URL = 'https://auth.devcycle.com/' | ||
|
||
const DVC_IDENTIFIER = 'github.code_usages' | ||
|
||
export async function run() { | ||
const requiredInputs = ['github-token', 'project-key', 'client-id', 'client-secret'] | ||
for (const inputKey of requiredInputs) { | ||
|
@@ -24,11 +26,11 @@ export async function run() { | |
} | ||
|
||
try { | ||
await exec('npm', ['install', '-g', '@devcycle/[email protected].8']) | ||
await exec('npm', ['install', '-g', '@devcycle/[email protected].10']) | ||
|
||
const output = await getExecOutput( | ||
'dvc', | ||
['usages', '--format', 'json'] | ||
['usages', '--format', 'json', '--caller', DVC_IDENTIFIER] | ||
) | ||
const variables = JSON.parse(output.stdout) | ||
|
||
|
@@ -65,7 +67,8 @@ export const postCodeUsages = async (variables: any[]): Promise<void> => { | |
const url = new URL(`/v1/projects/${projectKey}/codeUsages`, API_URL) | ||
|
||
const headers = { | ||
Authorization: authToken | ||
Authorization: authToken, | ||
'dvc-referrer': DVC_IDENTIFIER | ||
} | ||
const { owner, repo } = github.context.repo | ||
|
||
|