Skip to content

Commit 25abde9

Browse files
authored
chore(ci): fix workflows (#1596)
Fix the CI workflows for release and for labeling issues.
1 parent 7270949 commit 25abde9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/label-issues.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- opened
77
- transferred
88

9+
permissions:
10+
issues: write
11+
912
jobs:
1013
label-issue:
1114
runs-on: ubuntu-latest
@@ -31,7 +34,7 @@ jobs:
3134
let labels = [];
3235
if (context.payload.action === 'transferred') {
3336
// Label based on source repository
34-
const sourceRepo = context.payload.changes.new_repository.full_name;
37+
const sourceRepo = context.payload.changes?.old_repository?.full_name || context.payload.changes?.from?.full_name || context.payload.changes?.new_repository?.full_name;
3538
const label = labelMap[sourceRepo];
3639
if (label) labels.push(label);
3740
} else if (context.payload.action === 'opened') {
@@ -58,12 +61,12 @@ jobs:
5861
labels = [...new Set(labels)];
5962
6063
if (labels.length > 0) {
61-
await github.issues.addLabels({
64+
await github.rest.issues.addLabels({
6265
owner: context.repo.owner,
6366
repo: context.repo.repo,
64-
issue_number: context.issue.number,
67+
issue_number: context.payload.issue.number,
6568
labels,
6669
});
6770
} else {
6871
console.log('No matching label found; no label added.');
69-
}
72+
}

.github/workflows/publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
name: Publish releases
12
# Consolidates canary and stable releases into single workflow
23
# Trusted workflow for publishing to npm
34

4-
name: Publish releases
5-
65
on:
76
push:
87
branches: [master]
@@ -114,7 +113,7 @@ jobs:
114113
name: Generate Documentation
115114
needs: release-stable
116115
if: ${{
117-
github.event_name == 'workflow_dispatch &&
116+
github.event_name == 'workflow_dispatch' &&
118117
needs.release-stable.result == 'success'
119118
}}
120119
uses: ./.github/workflows/docs.yml

0 commit comments

Comments
 (0)