MCPcopy Index your code
hub / github.com/peter-evans/create-pull-request / getAndUnset

Method getAndUnset

src/git-config-helper.ts:222–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220 }
221
222 private async getAndUnset(): Promise<string> {
223 let configValue = ''
224 // Save and unset persisted extraheader credential in git config if it exists
225 if (
226 await this.git.configExists(
227 this.extraheaderConfigKey,
228 this.extraheaderConfigValueRegex
229 )
230 ) {
231 configValue = await this.git.getConfigValue(
232 this.extraheaderConfigKey,
233 this.extraheaderConfigValueRegex
234 )
235 if (
236 await this.git.tryConfigUnset(
237 this.extraheaderConfigKey,
238 this.extraheaderConfigValueRegex
239 )
240 ) {
241 core.info(`Unset config key '${this.extraheaderConfigKey}'`)
242 } else {
243 core.warning(
244 `Failed to unset config key '${this.extraheaderConfigKey}'`
245 )
246 }
247 }
248 return configValue
249 }
250
251 private async gitConfigStringReplace(
252 find: string,

Callers 2

savePersistedAuthMethod · 0.95
removeAuthMethod · 0.95

Calls 3

configExistsMethod · 0.80
getConfigValueMethod · 0.80
tryConfigUnsetMethod · 0.80

Tested by

no test coverage detected