Skip to content

Commit

Permalink
ci: fix and improve automation around MAINTAINERS.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet committed Feb 7, 2025
1 parent ec9bb68 commit fdd4f67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/maintainer_management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN_ORG_ADMIN: ${{ secrets.GH_TOKEN_ORG_ADMIN }}

jobs:
detect_maintainer_changes:
Expand Down Expand Up @@ -97,8 +98,8 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log(process.env)
const ghToken = process.env.GH_TOKEN;
console.log(process.env);
const ghTokenOrgAdmin = process.env.GH_TOKEN_ORG_ADMIN;
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
for (const maintainer of newMaintainers) {
Expand All @@ -107,7 +108,7 @@ jobs:
await fetch(`https://api.github.com/orgs/asyncapi/teams/maintainers/memberships/${maintainer}`, {
method: 'PUT',
headers: {
'Authorization': `token ${ghToken}`,
'Authorization': `token ${ghTokenOrgAdmin}`,
},
}).then(response => response.json())
.then(data => console.log(data));
Expand Down

0 comments on commit fdd4f67

Please sign in to comment.