Skip to content

Commit 65212dd

Browse files
authored
ci: fix HTTP PUT request to the GitHub REST API (#1664)
1 parent 1f80fcb commit 65212dd

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

.github/workflows/maintainer_management.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ on:
55
types: [closed]
66
paths:
77
- 'MAINTAINERS.yaml'
8+
89
env:
9-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
10+
GH_TOKEN_ORG_ADMIN: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
1011

1112
jobs:
1213
detect_maintainer_changes:
@@ -75,11 +76,11 @@ jobs:
7576
7677
- name: Debug newMaintainers output
7778
run: |
78-
echo "newMaintainers = $newMaintainers"
79+
echo "newMaintainers = ${{ steps.compare-files.outputs.newMaintainers }}"
7980
8081
- name: Debug removedMaintainers output
8182
run: |
82-
echo "removedMaintainers = $removedMaintainers"
83+
echo "removedMaintainers = ${{ steps.compare-files.outputs.removedMaintainers }}"
8384
8485
outputs:
8586
newMaintainers: ${{ steps.compare-files.outputs.newMaintainers }}
@@ -94,7 +95,7 @@ jobs:
9495
- name: Invite new maintainers to the organization
9596
uses: actions/github-script@v6
9697
with:
97-
github-token: ${{ env.GH_TOKEN }}
98+
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
9899
script: |
99100
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
100101
for (const maintainer of newMaintainers) {
@@ -111,7 +112,7 @@ jobs:
111112
- name: Add new maintainers to the team
112113
uses: actions/github-script@v6
113114
with:
114-
github-token: ${{ env.GH_TOKEN }}
115+
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
115116
script: |
116117
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
117118
for (const maintainer of newMaintainers) {
@@ -137,7 +138,7 @@ jobs:
137138
- name: Display welcome message for new maintainers
138139
uses: actions/github-script@v6
139140
with:
140-
github-token: ${{ secrets.GH_TOKEN }}
141+
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
141142
script: |
142143
const newMaintainers = "${{ needs.add_maintainer.outputs.newMaintainers }}".split(",");
143144
console.log(`New maintainers: ${newMaintainers}`);
@@ -161,12 +162,13 @@ jobs:
161162
- name: Remove maintainers from the organization
162163
uses: actions/github-script@v6
163164
with:
164-
github-token: ${{ env.GH_TOKEN }}
165+
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
165166
script: |
166167
const removedMaintainers = '${{ needs.detect_maintainer_changes.outputs.removedMaintainers }}'.split(',');
167168
for (const maintainer of removedMaintainers) {
168169
try {
169-
await github.request('DELETE /orgs/asyncapi/memberships/{username}', {
170+
await github.request('DELETE /orgs/{org}/memberships/{username}', {
171+
org: 'asyncapi',
170172
username: maintainer
171173
});
172174
core.info(`Successfully removed ${maintainer} from the organization.`);
@@ -187,7 +189,7 @@ jobs:
187189
- name: Display goodbye message to removed maintainers
188190
uses: actions/github-script@v6
189191
with:
190-
github-token: ${{ env.GH_TOKEN }}
192+
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
191193
script: |
192194
const removedMaintainers = "${{ needs.remove_maintainer.outputs.removedMaintainers }}".split(",");
193195
const removedTscMembers = "${{ needs.remove_maintainer.outputs.removedTscMembers }}".split(",");
@@ -218,7 +220,7 @@ jobs:
218220
- name: Add TSC members to Emeritus.yaml and print
219221
uses: actions/github-script@v6
220222
with:
221-
github-token: ${{ env.GH_TOKEN }}
223+
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
222224
script: |
223225
const fs = require('fs');
224226
const path = './Emeritus.yaml';
@@ -249,8 +251,9 @@ jobs:
249251
- name: Commit and push
250252
run: |
251253
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 }}
254257
255258
- name: Create PR
256259
run: |
@@ -267,4 +270,4 @@ jobs:
267270
SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}}
268271
SLACK_TITLE: 🚨 Maintainer Management Workflow failed 🚨
269272
SLACK_MESSAGE: Failed to post a message to new Maintainer
270-
MSG_MINIMAL: true
273+
MSG_MINIMAL: true

Emeritus.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# This file lists individuals who were previously TSC members and Ambassadors but are no longer active.
22

3+
emeritus_ambassadors:
4+
- jessemenning
5+
- meteatamel
6+
- raphaeldelio
7+
38
emeritus_tsc:
49
- jotamusik
510
- LouisXhaferi
@@ -18,8 +23,3 @@ emeritus_tsc:
1823
- emilianozublena
1924
- NektariosFifes
2025
- M3lkior
21-
22-
emeritus_ambassadors:
23-
- jessemenning
24-
- meteatamel
25-
- raphaeldelio

0 commit comments

Comments
 (0)