Merge pull request #288 from crazy-max/bake-auth-token · docker/actions-toolkit@0200700 (original) (raw)

`@@ -77,24 +77,23 @@ export class Inputs {

`

77

77

`}

`

78

78

``

79

79

`public static resolveBuildSecretString(kvp: string): string {

`

80

``

`-

return Inputs.resolveBuildSecret(kvp, false);

`

``

80

`+

const [key, file] = Inputs.resolveBuildSecret(kvp, false);

`

``

81

`` +

return id=${key},src=${file};

``

81

82

`}

`

82

83

``

83

84

`public static resolveBuildSecretFile(kvp: string): string {

`

84

``

`-

return Inputs.resolveBuildSecret(kvp, true);

`

``

85

`+

const [key, file] = Inputs.resolveBuildSecret(kvp, true);

`

``

86

`` +

return id=${key},src=${file};

``

85

87

`}

`

86

88

``

87

89

`public static resolveBuildSecretEnv(kvp: string): string {

`

88

90

`const [key, value] = parseKvp(kvp);

`

89

``

-

90

91

`` return id=${key},env=${value};

``

91

92

`}

`

92

93

``

93

``

`-

public static resolveBuildSecret(kvp: string, file: boolean): string {

`

``

94

`+

public static resolveBuildSecret(kvp: string, file: boolean): [string, string] {

`

94

95

`const [key, _value] = parseKvp(kvp);

`

95

``

-

96

96

`let value = _value;

`

97

``

-

98

97

`if (file) {

`

99

98

`if (!fs.existsSync(value)) {

`

100

99

`` throw new Error(secret file ${value} not found);

``

`@@ -103,7 +102,7 @@ export class Inputs {

`

103

102

`}

`

104

103

`const secretFile = Context.tmpName({tmpdir: Context.tmpDir()});

`

105

104

`fs.writeFileSync(secretFile, value);

`

106

``

`` -

return id=${key},src=${secretFile};

``

``

105

`+

return [key, secretFile];

`

107

106

`}

`

108

107

``

109

108

`public static getProvenanceInput(name: string): string {

`