mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[CI] Prevent skippable changes pr break (#188740)
## Summary Closes: https://github.com/elastic/kibana-operations/issues/159
This commit is contained in:
parent
a8091ab0ac
commit
03148d203f
1 changed files with 5 additions and 10 deletions
|
@ -6,12 +6,12 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { execSync } from 'child_process';
|
||||
import fs from 'fs';
|
||||
import prConfigs from '../../../pull_requests.json';
|
||||
import { areChangesSkippable, doAnyChangesMatch, getAgentImageConfig } from '#pipeline-utils';
|
||||
|
||||
const prConfig = prConfigs.jobs.find((job) => job.pipelineSlug === 'kibana-pull-request');
|
||||
const emptyStep = `steps: []`;
|
||||
|
||||
if (!prConfig) {
|
||||
console.error(`'kibana-pull-request' pipeline not found in .buildkite/pull_requests.json`);
|
||||
|
@ -28,21 +28,16 @@ const getPipeline = (filename: string, removeSteps = true) => {
|
|||
};
|
||||
|
||||
(async () => {
|
||||
const pipeline: string[] = [];
|
||||
|
||||
try {
|
||||
const skippable = await areChangesSkippable(SKIPPABLE_PR_MATCHERS, REQUIRED_PATHS);
|
||||
|
||||
if (skippable) {
|
||||
console.log('All changes in PR are skippable. Skipping CI.');
|
||||
|
||||
// Since we skip everything, including post-build, we need to at least make sure the commit status gets set
|
||||
execSync('BUILD_SUCCESSFUL=true .buildkite/scripts/lifecycle/commit_status_complete.sh', {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
process.exit(0);
|
||||
console.log(emptyStep);
|
||||
return;
|
||||
}
|
||||
|
||||
const pipeline = [];
|
||||
|
||||
pipeline.push(getAgentImageConfig({ returnYaml: true }));
|
||||
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/base.yml', false));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue