mirror of
https://github.com/actions/toolkit
synced 2025-05-10 09:03:02 +00:00
parent
4beda9cbc0
commit
30995490f2
4 changed files with 6491 additions and 6653 deletions
|
@ -4,7 +4,7 @@ import {toCommandProperties, toCommandValue} from './utils'
|
|||
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import {v4 as uuidv4} from 'uuid'
|
||||
|
||||
import {OidcClient} from './oidc-utils'
|
||||
|
||||
|
@ -89,13 +89,17 @@ export function exportVariable(name: string, val: any): void {
|
|||
if (filePath) {
|
||||
const delimiter = `ghadelimiter_${uuidv4()}`
|
||||
|
||||
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
|
||||
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
|
||||
if (name.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`)
|
||||
throw new Error(
|
||||
`Unexpected input: name should not contain the delimiter "${delimiter}"`
|
||||
)
|
||||
}
|
||||
|
||||
if (convertedVal.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`)
|
||||
throw new Error(
|
||||
`Unexpected input: value should not contain the delimiter "${delimiter}"`
|
||||
)
|
||||
}
|
||||
|
||||
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue