Skip to content

Commit

Permalink
ci: update process of passing auth token (#1715)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet authored Feb 12, 2025
1 parent 053e240 commit a8175b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/maintainer_management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
paths:
- 'MAINTAINERS.yaml'

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

jobs:
detect_maintainer_changes:
if: github.event.pull_request.merged
Expand Down Expand Up @@ -95,7 +92,7 @@ jobs:
- name: Invite new maintainers to the organization
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
script: |
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
for (const maintainer of newMaintainers) {
Expand All @@ -112,7 +109,7 @@ jobs:
- name: Add new maintainers to the team
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
script: |
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
for (const maintainer of newMaintainers) {
Expand All @@ -138,7 +135,7 @@ jobs:
- name: Display welcome message for new maintainers
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
script: |
const newMaintainers = "${{ needs.add_maintainer.outputs.newMaintainers }}".split(",");
console.log(`New maintainers: ${newMaintainers}`);
Expand All @@ -162,7 +159,7 @@ jobs:
- name: Remove maintainers from the organization
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
script: |
const removedMaintainers = '${{ needs.detect_maintainer_changes.outputs.removedMaintainers }}'.split(',');
for (const maintainer of removedMaintainers) {
Expand All @@ -189,7 +186,7 @@ jobs:
- name: Display goodbye message to removed maintainers
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
script: |
const removedMaintainers = "${{ needs.remove_maintainer.outputs.removedMaintainers }}".split(",");
const removedTscMembers = "${{ needs.remove_maintainer.outputs.removedTscMembers }}".split(",");
Expand Down Expand Up @@ -220,7 +217,7 @@ jobs:
- name: Add TSC members to Emeritus.yaml and print
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN_ORG_ADMIN }}
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
script: |
const fs = require('fs');
const path = './Emeritus.yaml';
Expand Down Expand Up @@ -252,7 +249,7 @@ jobs:
run: |
git add .
git commit -m "chore: update Emeritus.yaml"
git remote set-url origin https://x-access-token:${{ env.GH_TOKEN_ORG_ADMIN }}@github.com/asyncapi/community.git
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN_ORG_ADMIN }}@github.com/asyncapi/community.git
git push origin update-emeritus-${{ github.run_id }}
- name: Create PR
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/maintainers-tsc-changes-verification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
id: verify-changes
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
script: |
const yaml = require("js-yaml");
const fs = require("fs");
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
- name: Comment and close the PR if there are any critical changes done by human
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
script: |
const errorMessagesString = `${{ needs.verify-changes-if-tsc-if-maintainers.outputs.errorMessages }}`;
const errorMessages = errorMessagesString ? JSON.parse(errorMessagesString) : [];
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
if: steps.verify-changes-if-tsc-if-maintainers.outputs.removedTscMembers != ''
uses: actions/github-script@v6
with:
github-token: ${{ env.GH_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
script: |
const issueComment = {
owner: github.context.repo.owner,
Expand Down

0 comments on commit a8175b0

Please sign in to comment.