5
5
types : [closed]
6
6
paths :
7
7
- ' MAINTAINERS.yaml'
8
+
8
9
env :
9
- GH_TOKEN : ${{ secrets.GH_TOKEN }}
10
+ GH_TOKEN_ORG_ADMIN : ${{ secrets.GH_TOKEN_ORG_ADMIN }}
10
11
11
12
jobs :
12
13
detect_maintainer_changes :
@@ -75,11 +76,11 @@ jobs:
75
76
76
77
- name : Debug newMaintainers output
77
78
run : |
78
- echo "newMaintainers = $newMaintainers"
79
+ echo "newMaintainers = ${{ steps.compare-files.outputs. newMaintainers }} "
79
80
80
81
- name : Debug removedMaintainers output
81
82
run : |
82
- echo "removedMaintainers = $removedMaintainers"
83
+ echo "removedMaintainers = ${{ steps.compare-files.outputs. removedMaintainers }} "
83
84
84
85
outputs :
85
86
newMaintainers : ${{ steps.compare-files.outputs.newMaintainers }}
94
95
- name : Invite new maintainers to the organization
95
96
uses : actions/github-script@v6
96
97
with :
97
- github-token : ${{ env.GH_TOKEN }}
98
+ github-token : ${{ env.GH_TOKEN_ORG_ADMIN }}
98
99
script : |
99
100
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
100
101
for (const maintainer of newMaintainers) {
@@ -111,7 +112,7 @@ jobs:
111
112
- name : Add new maintainers to the team
112
113
uses : actions/github-script@v6
113
114
with :
114
- github-token : ${{ env.GH_TOKEN }}
115
+ github-token : ${{ env.GH_TOKEN_ORG_ADMIN }}
115
116
script : |
116
117
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
117
118
for (const maintainer of newMaintainers) {
@@ -137,7 +138,7 @@ jobs:
137
138
- name : Display welcome message for new maintainers
138
139
uses : actions/github-script@v6
139
140
with :
140
- github-token : ${{ secrets.GH_TOKEN }}
141
+ github-token : ${{ env.GH_TOKEN_ORG_ADMIN }}
141
142
script : |
142
143
const newMaintainers = "${{ needs.add_maintainer.outputs.newMaintainers }}".split(",");
143
144
console.log(`New maintainers: ${newMaintainers}`);
@@ -161,12 +162,13 @@ jobs:
161
162
- name : Remove maintainers from the organization
162
163
uses : actions/github-script@v6
163
164
with :
164
- github-token : ${{ env.GH_TOKEN }}
165
+ github-token : ${{ env.GH_TOKEN_ORG_ADMIN }}
165
166
script : |
166
167
const removedMaintainers = '${{ needs.detect_maintainer_changes.outputs.removedMaintainers }}'.split(',');
167
168
for (const maintainer of removedMaintainers) {
168
169
try {
169
- await github.request('DELETE /orgs/asyncapi/memberships/{username}', {
170
+ await github.request('DELETE /orgs/{org}/memberships/{username}', {
171
+ org: 'asyncapi',
170
172
username: maintainer
171
173
});
172
174
core.info(`Successfully removed ${maintainer} from the organization.`);
@@ -187,7 +189,7 @@ jobs:
187
189
- name : Display goodbye message to removed maintainers
188
190
uses : actions/github-script@v6
189
191
with :
190
- github-token : ${{ env.GH_TOKEN }}
192
+ github-token : ${{ env.GH_TOKEN_ORG_ADMIN }}
191
193
script : |
192
194
const removedMaintainers = "${{ needs.remove_maintainer.outputs.removedMaintainers }}".split(",");
193
195
const removedTscMembers = "${{ needs.remove_maintainer.outputs.removedTscMembers }}".split(",");
@@ -218,7 +220,7 @@ jobs:
218
220
- name : Add TSC members to Emeritus.yaml and print
219
221
uses : actions/github-script@v6
220
222
with :
221
- github-token : ${{ env.GH_TOKEN }}
223
+ github-token : ${{ env.GH_TOKEN_ORG_ADMIN }}
222
224
script : |
223
225
const fs = require('fs');
224
226
const path = './Emeritus.yaml';
@@ -249,8 +251,9 @@ jobs:
249
251
- name : Commit and push
250
252
run : |
251
253
git add .
252
- git commit -m "Update Emeritus.yaml"
253
- git push https://${{ secrets.GH_TOKEN}}@github.com/asyncapi/community update-emeritus-${{ github.run_id }}
254
+ git commit -m "chore: update Emeritus.yaml"
255
+ git remote set-url origin https://x-access-token:${{ env.GH_TOKEN_ORG_ADMIN }}@github.com/asyncapi/community.git
256
+ git push origin update-emeritus-${{ github.run_id }}
254
257
255
258
- name : Create PR
256
259
run : |
@@ -267,4 +270,4 @@ jobs:
267
270
SLACK_WEBHOOK : ${{secrets.SLACK_CI_FAIL_NOTIFY}}
268
271
SLACK_TITLE : 🚨 Maintainer Management Workflow failed 🚨
269
272
SLACK_MESSAGE : Failed to post a message to new Maintainer
270
- MSG_MINIMAL : true
273
+ MSG_MINIMAL : true
0 commit comments