Skip to content

Commit fcd4bd0

Browse files
committed
Add fallback in case issue doesn't have [safe-for-test] label
1 parent 3efec18 commit fcd4bd0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/run-tests.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ jobs:
1818
const issue_number = context.issue.number;
1919
const repository = context.repo.repo;
2020
const owner = context.repo.owner;
21-
await github.rest.issues.removeLabel({
21+
const response = await github.rest.issues.listLabelsOnIssue({
2222
owner,
2323
repo: repository,
24-
issue_number,
25-
name: 'safe-to-test'
24+
issue_number
2625
});
26+
const labels = response.data.map(label => label.name);
27+
if (labels.includes('safe-to-test')) {
28+
await github.rest.issues.removeLabel({
29+
owner,
30+
repo: repository,
31+
issue_number,
32+
name: 'safe-to-test'
33+
});
34+
}
2735
2836
access_check:
2937
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)