feat: ignore initialization of virtual merge commits

Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
This commit is contained in:
Aleksei Igrychev
2023-12-21 22:13:33 +00:00
parent 123d59749a
commit ed26ed00c3
8 changed files with 35 additions and 107 deletions

View File

@@ -47,13 +47,17 @@ export async function SetupKubeConfig(
export function ProcessGitHubContext(): void {
if (context.eventName === 'pull_request') {
if (context.payload.pull_request) {
// Do nothing if virtual merge variable is already set
if (process.env.WERF_VIRTUAL_MERGE) {
return
}
const baseSha = context.payload.pull_request.base.sha
const headSha = context.payload.pull_request.head.sha
process.env.WERF_VIRTUAL_MERGE = '1'
process.env.WERF_VIRTUAL_MERGE_FROM_COMMIT = headSha
process.env.WERF_VIRTUAL_MERGE_INTO_COMMIT = baseSha
core.exportVariable('WERF_VIRTUAL_MERGE', '1')
core.exportVariable('WERF_VIRTUAL_MERGE_FROM_COMMIT', headSha)
core.exportVariable('WERF_VIRTUAL_MERGE_INTO_COMMIT', baseSha)

View File

@@ -5,7 +5,7 @@ import {ProcessGitHubContext} from './common'
async function run(): Promise<void> {
try {
ProcessGitHubContext()
const m = new Manager()
await m.Install()
} catch (error) {