CI - Use LSTT machine to enable labeling
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
[ROCm/rdc commit: 31dfc0fcce]
这个提交包含在:
1 父节点
45e62ada3d
当前提交
b574154bce
1 个文件已更改
+5
-10
+5
-10
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add-label:
|
add-label:
|
||||||
runs-on: ubuntu-latest
|
runs-on: lstt
|
||||||
container:
|
container:
|
||||||
image: node:16-alpine
|
image: node:16-alpine
|
||||||
permissions:
|
permissions:
|
||||||
@@ -18,18 +18,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const pr = context.payload.pull_request;
|
const pr = context.payload.pull_request;
|
||||||
const headBranch = pr.head.ref;
|
|
||||||
const baseBranch = pr.base.ref;
|
const baseBranch = pr.base.ref;
|
||||||
|
|
||||||
// Check if head branch contains cherry-pick pattern or base branch starts with release/
|
|
||||||
const isCherryPick = /cherry.*pick/i.test(headBranch);
|
|
||||||
const isReleaseTarget = baseBranch.startsWith('release/');
|
const isReleaseTarget = baseBranch.startsWith('release/');
|
||||||
|
|
||||||
if (isCherryPick || isReleaseTarget) {
|
if (isReleaseTarget) {
|
||||||
// Label to apply
|
|
||||||
const labelToAdd = 'cherry-pick';
|
const labelToAdd = 'cherry-pick';
|
||||||
|
|
||||||
// Try to add the label
|
|
||||||
try {
|
try {
|
||||||
await github.rest.issues.addLabels({
|
await github.rest.issues.addLabels({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
@@ -37,11 +32,11 @@ jobs:
|
|||||||
issue_number: pr.number,
|
issue_number: pr.number,
|
||||||
labels: [labelToAdd]
|
labels: [labelToAdd]
|
||||||
});
|
});
|
||||||
console.log(`Added label "${labelToAdd}" to PR #${pr.number}`);
|
console.log("Added label ${labelToAdd} to PR #${pr.number}");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error adding label: ${error.message}`);
|
console.error("Error adding label: ${error.message}");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('PR does not match criteria for automatic labeling');
|
console.log("PR does not match criteria for automatic labeling");
|
||||||
}
|
}
|
||||||
|
|
||||||
在新工单中引用
屏蔽一个用户