Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Jun 23, 2022
1 parent a87d5c0 commit 30278ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/functions/prechecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function prechecks(
// check if comment starts with the env.DEPLOY_COMMAND variable followed by the 'main' branch or if this is for the current branch
var ref = pr.data.head.ref
var noopMode = false
var forkBypass = false

// Regex statements for checking the trigger message
const regexCommandWithStableBranch = new RegExp(
Expand All @@ -60,6 +61,7 @@ export async function prechecks(
// Check to see if the "stable" branch was used as the deployment target
if (regexCommandWithStableBranch.test(comment)) {
ref = stable_branch
forkBypass = true
core.info(
`${trigger} command used with '${stable_branch}' branch - setting ref to ${ref}`
)
Expand Down Expand Up @@ -91,7 +93,7 @@ export async function prechecks(

// Determine whether to use the ref or sha depending on if the PR is from a fork or not
// Note: We should not export fork values if the stable_branch is being used here
if (pr.data.head.repo?.fork === true && ref != stable_branch) {
if (pr.data.head.repo?.fork === true && forkBypass === false) {
core.info(`PR is from a fork, using sha instead of ref`)
core.setOutput('fork', 'true')

Expand Down

0 comments on commit 30278ba

Please sign in to comment.