Skip to content

Commit

Permalink
action.cjs: disable renovate/dependabot generation in subtle_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed May 10, 2024
1 parent e5a2dd4 commit d1e697c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module.exports = async ({ github, context, inputs, actionPath }) => {
const { default: getConfig } = await import(`${actionPath}/src/getConfig.js`)
const { default: getProperties } = await import(`${actionPath}/src/getProperties.js`)

const raise = (message) => { throw new Error(message) }

// delete if empty string in inputs value
Object.keys(inputs).forEach(key => inputs[key] === '' && delete inputs[key])

Expand Down Expand Up @@ -45,9 +47,9 @@ module.exports = async ({ github, context, inputs, actionPath }) => {
: await import(`${actionPath}/src/submitReview.js`)

const { default: getPatch } = (context.payload.pull_request && context.payload.pull_request.user.login === 'renovate[bot]') || context.actor === 'renovate[bot]'
? await import(`${actionPath}/src/getRenovatePatch.js`)
? options.subtle_mode ? raise('subtle_mode enabled, this is not supported for renovate') : await import(`${actionPath}/src/getRenovatePatch.js`)
: (context.payload.pull_request && context.payload.pull_request.user.login === 'dependabot[bot]') || context.actor === 'dependabot[bot]'
? await import(`${actionPath}/src/getDependabotPatch.js`)
? options.subtle_mode ? raise('subtle_mode enabled, this is not supported for dependabot') : await import(`${actionPath}/src/getDependabotPatch.js`)
: await import(`${actionPath}/src/getPatch.js`)

options.key = options.anthropic_api_key || options.openai_api_key
Expand Down

0 comments on commit d1e697c

Please sign in to comment.