-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'a55a34798922fdbd6fd9dab3ac4c4fe08782f2ac' into feature/…
…security-only-updates
- Loading branch information
Showing
6 changed files
with
233 additions
and
115 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
31 changes: 31 additions & 0 deletions
31
extension/tasks/dependabotV2/utils/azure-devops/formattingCommands.ts
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Formats the logs into groups and sections to allow for easier navigation and readability. | ||
* https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#formatting-commands | ||
*/ | ||
|
||
export function group(name: string) { | ||
console.log(`##[group]${name}`); | ||
} | ||
|
||
export function endgroup() { | ||
console.log(`##[endgroup]`); | ||
} | ||
|
||
export function section(name: string) { | ||
console.log(`##[section]${name}`); | ||
} | ||
|
||
/** | ||
* Masks the supplied values in the task log output. | ||
* https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#setsecret-register-a-value-as-a-secret | ||
*/ | ||
|
||
import { setSecret } from 'azure-pipelines-task-lib'; | ||
export function setSecrets(...args: string[]) { | ||
for (const arg of args.filter((a) => a && a?.toLowerCase() !== 'dependabot')) { | ||
// Mask the value and the uri encoded value. This is required to ensure that API and package feed url don't expose the value. | ||
// e.g. "Contoso Ltd" would appear as "Contoso%20Ltd" unless the uri encoded value was set as a secret. | ||
setSecret(arg); | ||
setSecret(encodeURIComponent(arg)); | ||
} | ||
} |
Oops, something went wrong.