mirror of
https://github.com/werf/actions.git
synced 2026-02-05 10:56:23 +03:00
feat: ignore initialization of virtual merge commits
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -5,7 +5,7 @@ import {ProcessGitHubContext} from './common'
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
ProcessGitHubContext()
|
||||
|
||||
|
||||
const m = new Manager()
|
||||
await m.Install()
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user