Skip to content

Option to overwrite branch name? #775

@rbo

Description

@rbo

Hello,

is there a chance to overwrite the branch name:

const {stdout} = await execFileAsync(
'npx',
[
`wrangler@${WRANGLER_VERSION}`,
'pages',
'deploy',
directory,
'--project-name',
projectName,
'--branch',
branch,
'--commit-dirty=true',
'--commit-hash',
commitHash
],
{
env: process.env,
cwd: workingDirectory
}
)

Because, if I'm using the action via workflow_run and the PR is created based on a fork from the main branch (exmaple) it overwrite the main/production deployment. But I would like to create a preview, for example, with pr-XXX

To be honst, I don't get the part in the your docs:

github-environment: ${{ (github.ref == 'refs/heads/main' && 'production') || 'preview' }}

I just have one environment on GitHub which represents a page in Cloudflare. Inside the Cloudflare page, I have different environments (Production & Preview). Production always has a main as source and preview pr-xxxx.

Thank you for your assistance.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions