mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-15 07:03:52 +01:00
Dev/pr automation 6 (#1575)
* user should be allowed to manually remove detector label * automation script fix
This commit is contained in:
1 parent
7a2ff7715f
commit
32437267ef
1 file changed
+33
-5
@@ -23,6 +23,7 @@ jobs:
|
||||
outputs:
|
||||
require_validation: ${{ steps.check.outputs.require_validation }}
|
||||
file_label_change: ${{ steps.check.outputs.file_label_change }}
|
||||
detector_label_change: ${{ steps.check.outputs.detector_label_change }}
|
||||
pr_edited: ${{ steps.check.outputs.pr_edited }}
|
||||
|
||||
steps:
|
||||
@@ -33,6 +34,7 @@ jobs:
|
||||
script: |
|
||||
let requireValidation = true;
|
||||
let fileLabelChange = false;
|
||||
let detectorLabelChange = false;
|
||||
|
||||
/*
|
||||
* If triggered by label change, ignore unrelated labels.
|
||||
@@ -65,8 +67,22 @@ jobs:
|
||||
];
|
||||
if (fileLabels.includes(changedLabel)) {
|
||||
fileLabelChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const detectorLabels = [
|
||||
'Ctb',
|
||||
'Eiger',
|
||||
'Moench',
|
||||
'Mythen3',
|
||||
'Jungfrau',
|
||||
'Gotthard2',
|
||||
'Matterhorn',
|
||||
'Xilinx_ctb'
|
||||
];
|
||||
if (detectorLabels.includes(changedLabel)) {
|
||||
detectorLabelChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
core.setOutput(
|
||||
'require_validation',
|
||||
@@ -76,6 +92,10 @@ jobs:
|
||||
'file_label_change',
|
||||
fileLabelChange.toString()
|
||||
);
|
||||
core.setOutput(
|
||||
'detector_label_change',
|
||||
detectorLabelChange.toString()
|
||||
);
|
||||
core.setOutput(
|
||||
'pr_edited',
|
||||
prEdited.toString()
|
||||
@@ -90,7 +110,12 @@ jobs:
|
||||
core.info('File label or Breaking API: Changed.');
|
||||
} else {
|
||||
core.info('File label or Breaking API: No Change.');
|
||||
}
|
||||
}
|
||||
if (detectorLabelChange) {
|
||||
core.info('Detector label: Changed.');
|
||||
} else {
|
||||
core.info('Detector label: No Change.');
|
||||
}
|
||||
|
||||
validate-pr-type:
|
||||
needs: check-pr-trigger
|
||||
@@ -129,8 +154,11 @@ jobs:
|
||||
${{
|
||||
always() &&
|
||||
(
|
||||
needs.check-pr-trigger.outputs.require_validation == 'false' ||
|
||||
needs.validate-pr-type.result == 'success'
|
||||
needs.check-pr-trigger.outputs.detector_label_change == 'false' &&
|
||||
(
|
||||
needs.check-pr-trigger.outputs.require_validation == 'false' ||
|
||||
needs.validate-pr-type.result == 'success'
|
||||
)
|
||||
)
|
||||
}}
|
||||
uses: ./.github/workflows/pr_detector_labels.yaml
|
||||
|
||||
Reference in new issue
Block a user