Skip to content

Commit

Permalink
feat: add an optional environment variable that specifies the branch …
Browse files Browse the repository at this point in the history
…name to search for deployments
  • Loading branch information
ykokw committed Oct 18, 2024
1 parent 80af398 commit dfb5628
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import * as core from '@actions/core'
import getDeploymentUrl from './vercel.js'

const githubBranch =
const searchBranchName = process.env.SEARCH_BRANCH_NAME || ''
const defaultGithubBranch =
process.env.GITHUB_EVENT_NAME === 'pull_request' ||
process.env.GITHUB_EVENT_NAME === 'pull_request_target'
? process.env.GITHUB_HEAD_REF
: process.env.GITHUB_REF.replace('refs/heads/', '')
const githubBranch =
searchBranchName.length > 0 ? searchBranchName : defaultGithubBranch
const githubProject = process.env.GITHUB_REPOSITORY
const githubRepo = githubProject.split('/')[1]
const vercelOptions = {
Expand Down

0 comments on commit dfb5628

Please sign in to comment.