mirror of
https://github.com/werf/actions.git
synced 2026-02-05 02:46:23 +03:00
Merge pull request #72 from werf/feat/ignore_virtual_merge_init
feat: ignore initialization of virtual merge commits
This commit is contained in:
@@ -31679,7 +31679,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = exports.Setup = void 0;
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = void 0;
|
||||
const core = __importStar(__nccwpck_require__(4181));
|
||||
const tmp = __importStar(__nccwpck_require__(3728));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
@@ -31689,26 +31689,6 @@ const typescript_string_operations_1 = __nccwpck_require__(9363);
|
||||
const manager_1 = __nccwpck_require__(1856);
|
||||
const werf = __importStar(__nccwpck_require__(8525));
|
||||
const minimalWerfVersion = 'v1.1.17';
|
||||
function Setup() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
ProcessGitHubContext();
|
||||
const kubeConfigBase64Data = core.getInput('kube-config-base64-data');
|
||||
if (kubeConfigBase64Data !== '') {
|
||||
SetupKubeConfig(kubeConfigBase64Data);
|
||||
}
|
||||
const m = new manager_1.Manager();
|
||||
yield m.Install();
|
||||
process.env.GITHUB_TOKEN =
|
||||
process.env.GITHUB_TOKEN || core.getInput('github-token');
|
||||
yield m.PerformCIEnv();
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.Setup = Setup;
|
||||
function PrepareEnvironAndRunWerfCommand(args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -31743,6 +31723,10 @@ exports.SetupKubeConfig = SetupKubeConfig;
|
||||
function ProcessGitHubContext() {
|
||||
if (github_1.context.eventName === 'pull_request') {
|
||||
if (github_1.context.payload.pull_request) {
|
||||
// Do nothing if virtual merge variable is already set
|
||||
if (process.env.WERF_VIRTUAL_MERGE) {
|
||||
return;
|
||||
}
|
||||
const baseSha = github_1.context.payload.pull_request.base.sha;
|
||||
const headSha = github_1.context.payload.pull_request.head.sha;
|
||||
process.env.WERF_VIRTUAL_MERGE = '1';
|
||||
|
||||
@@ -31679,7 +31679,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = exports.Setup = void 0;
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = void 0;
|
||||
const core = __importStar(__nccwpck_require__(4181));
|
||||
const tmp = __importStar(__nccwpck_require__(3728));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
@@ -31689,26 +31689,6 @@ const typescript_string_operations_1 = __nccwpck_require__(9363);
|
||||
const manager_1 = __nccwpck_require__(1856);
|
||||
const werf = __importStar(__nccwpck_require__(8525));
|
||||
const minimalWerfVersion = 'v1.1.17';
|
||||
function Setup() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
ProcessGitHubContext();
|
||||
const kubeConfigBase64Data = core.getInput('kube-config-base64-data');
|
||||
if (kubeConfigBase64Data !== '') {
|
||||
SetupKubeConfig(kubeConfigBase64Data);
|
||||
}
|
||||
const m = new manager_1.Manager();
|
||||
yield m.Install();
|
||||
process.env.GITHUB_TOKEN =
|
||||
process.env.GITHUB_TOKEN || core.getInput('github-token');
|
||||
yield m.PerformCIEnv();
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.Setup = Setup;
|
||||
function PrepareEnvironAndRunWerfCommand(args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -31743,6 +31723,10 @@ exports.SetupKubeConfig = SetupKubeConfig;
|
||||
function ProcessGitHubContext() {
|
||||
if (github_1.context.eventName === 'pull_request') {
|
||||
if (github_1.context.payload.pull_request) {
|
||||
// Do nothing if virtual merge variable is already set
|
||||
if (process.env.WERF_VIRTUAL_MERGE) {
|
||||
return;
|
||||
}
|
||||
const baseSha = github_1.context.payload.pull_request.base.sha;
|
||||
const headSha = github_1.context.payload.pull_request.head.sha;
|
||||
process.env.WERF_VIRTUAL_MERGE = '1';
|
||||
|
||||
@@ -31628,7 +31628,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = exports.Setup = void 0;
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = void 0;
|
||||
const core = __importStar(__nccwpck_require__(4181));
|
||||
const tmp = __importStar(__nccwpck_require__(3728));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
@@ -31638,26 +31638,6 @@ const typescript_string_operations_1 = __nccwpck_require__(9363);
|
||||
const manager_1 = __nccwpck_require__(1856);
|
||||
const werf = __importStar(__nccwpck_require__(8525));
|
||||
const minimalWerfVersion = 'v1.1.17';
|
||||
function Setup() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
ProcessGitHubContext();
|
||||
const kubeConfigBase64Data = core.getInput('kube-config-base64-data');
|
||||
if (kubeConfigBase64Data !== '') {
|
||||
SetupKubeConfig(kubeConfigBase64Data);
|
||||
}
|
||||
const m = new manager_1.Manager();
|
||||
yield m.Install();
|
||||
process.env.GITHUB_TOKEN =
|
||||
process.env.GITHUB_TOKEN || core.getInput('github-token');
|
||||
yield m.PerformCIEnv();
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.Setup = Setup;
|
||||
function PrepareEnvironAndRunWerfCommand(args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -31692,6 +31672,10 @@ exports.SetupKubeConfig = SetupKubeConfig;
|
||||
function ProcessGitHubContext() {
|
||||
if (github_1.context.eventName === 'pull_request') {
|
||||
if (github_1.context.payload.pull_request) {
|
||||
// Do nothing if virtual merge variable is already set
|
||||
if (process.env.WERF_VIRTUAL_MERGE) {
|
||||
return;
|
||||
}
|
||||
const baseSha = github_1.context.payload.pull_request.base.sha;
|
||||
const headSha = github_1.context.payload.pull_request.head.sha;
|
||||
process.env.WERF_VIRTUAL_MERGE = '1';
|
||||
|
||||
@@ -31628,7 +31628,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = exports.Setup = void 0;
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = void 0;
|
||||
const core = __importStar(__nccwpck_require__(4181));
|
||||
const tmp = __importStar(__nccwpck_require__(3728));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
@@ -31638,26 +31638,6 @@ const typescript_string_operations_1 = __nccwpck_require__(9363);
|
||||
const manager_1 = __nccwpck_require__(1856);
|
||||
const werf = __importStar(__nccwpck_require__(8525));
|
||||
const minimalWerfVersion = 'v1.1.17';
|
||||
function Setup() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
ProcessGitHubContext();
|
||||
const kubeConfigBase64Data = core.getInput('kube-config-base64-data');
|
||||
if (kubeConfigBase64Data !== '') {
|
||||
SetupKubeConfig(kubeConfigBase64Data);
|
||||
}
|
||||
const m = new manager_1.Manager();
|
||||
yield m.Install();
|
||||
process.env.GITHUB_TOKEN =
|
||||
process.env.GITHUB_TOKEN || core.getInput('github-token');
|
||||
yield m.PerformCIEnv();
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.Setup = Setup;
|
||||
function PrepareEnvironAndRunWerfCommand(args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -31692,6 +31672,10 @@ exports.SetupKubeConfig = SetupKubeConfig;
|
||||
function ProcessGitHubContext() {
|
||||
if (github_1.context.eventName === 'pull_request') {
|
||||
if (github_1.context.payload.pull_request) {
|
||||
// Do nothing if virtual merge variable is already set
|
||||
if (process.env.WERF_VIRTUAL_MERGE) {
|
||||
return;
|
||||
}
|
||||
const baseSha = github_1.context.payload.pull_request.base.sha;
|
||||
const headSha = github_1.context.payload.pull_request.head.sha;
|
||||
process.env.WERF_VIRTUAL_MERGE = '1';
|
||||
|
||||
@@ -31672,6 +31672,10 @@ exports.SetupKubeConfig = SetupKubeConfig;
|
||||
function ProcessGitHubContext() {
|
||||
if (github_1.context.eventName === 'pull_request') {
|
||||
if (github_1.context.payload.pull_request) {
|
||||
// Do nothing if virtual merge variable is already set
|
||||
if (process.env.WERF_VIRTUAL_MERGE) {
|
||||
return;
|
||||
}
|
||||
const baseSha = github_1.context.payload.pull_request.base.sha;
|
||||
const headSha = github_1.context.payload.pull_request.head.sha;
|
||||
process.env.WERF_VIRTUAL_MERGE = '1';
|
||||
|
||||
26
run/index.js
26
run/index.js
@@ -31680,7 +31680,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = exports.Setup = void 0;
|
||||
exports.ValidateWerfVersion = exports.ProcessGitHubContext = exports.SetupKubeConfig = exports.PrepareEnvironAndRunWerfCommand = void 0;
|
||||
const core = __importStar(__nccwpck_require__(4181));
|
||||
const tmp = __importStar(__nccwpck_require__(3728));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
@@ -31690,26 +31690,6 @@ const typescript_string_operations_1 = __nccwpck_require__(9363);
|
||||
const manager_1 = __nccwpck_require__(1856);
|
||||
const werf = __importStar(__nccwpck_require__(8525));
|
||||
const minimalWerfVersion = 'v1.1.17';
|
||||
function Setup() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
ProcessGitHubContext();
|
||||
const kubeConfigBase64Data = core.getInput('kube-config-base64-data');
|
||||
if (kubeConfigBase64Data !== '') {
|
||||
SetupKubeConfig(kubeConfigBase64Data);
|
||||
}
|
||||
const m = new manager_1.Manager();
|
||||
yield m.Install();
|
||||
process.env.GITHUB_TOKEN =
|
||||
process.env.GITHUB_TOKEN || core.getInput('github-token');
|
||||
yield m.PerformCIEnv();
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.Setup = Setup;
|
||||
function PrepareEnvironAndRunWerfCommand(args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -31744,6 +31724,10 @@ exports.SetupKubeConfig = SetupKubeConfig;
|
||||
function ProcessGitHubContext() {
|
||||
if (github_1.context.eventName === 'pull_request') {
|
||||
if (github_1.context.payload.pull_request) {
|
||||
// Do nothing if virtual merge variable is already set
|
||||
if (process.env.WERF_VIRTUAL_MERGE) {
|
||||
return;
|
||||
}
|
||||
const baseSha = github_1.context.payload.pull_request.base.sha;
|
||||
const headSha = github_1.context.payload.pull_request.head.sha;
|
||||
process.env.WERF_VIRTUAL_MERGE = '1';
|
||||
|
||||
@@ -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