Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update MAINTAINERS.yaml based on CODEOWNERS changes #248

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b69de5d
added new workflow
14Richa Jul 12, 2023
8e493d7
Update .github/workflows/update-maintainers.yml
14Richa Jul 12, 2023
70ffb1c
repo name fix
14Richa Jul 12, 2023
9ae74df
added create PR step
14Richa Jul 12, 2023
dcc8334
version change
14Richa Jul 12, 2023
3f60bfc
added slack alert
14Richa Jul 12, 2023
5cabea9
added twitter username code
14Richa Jul 15, 2023
7367b1f
added token
14Richa Jul 15, 2023
4de0eb2
fixed syntax error
14Richa Jul 17, 2023
9f31a73
Update .github/workflows/update-maintainers.yml
14Richa Jul 18, 2023
9fff056
fixed variable names
14Richa Jul 18, 2023
bcd504f
added code for maintainer already exists, and current repo is not in…
14Richa Jul 18, 2023
17dd441
added community repo code
14Richa Jul 18, 2023
073c252
minor fix
14Richa Jul 18, 2023
78f41e6
minor fix
14Richa Jul 18, 2023
8b56e2f
Update .github/workflows/update-maintainers.yml
14Richa Jul 18, 2023
0e97613
making regex comment proof
14Richa Jul 18, 2023
2acd8b3
excluding bot account before twitter api call
14Richa Jul 18, 2023
cf8d9fd
minor fix in remove codeowner code block
14Richa Jul 18, 2023
30b0293
remove ocktokit dependecy
14Richa Jul 19, 2023
a315646
Update .github/workflows/update-maintainers.yml
14Richa Jul 20, 2023
dc5b57b
changed token name
14Richa Jul 20, 2023
504fbfe
minor fix
14Richa Jul 25, 2023
7528dfd
changed console statement
14Richa Jul 25, 2023
1973052
Update .github/workflows/update-maintainers.yml
14Richa Jul 25, 2023
573771d
added the file in global replicator file
14Richa Jul 27, 2023
d409dc5
Merge branch '14Richa/update-maintainers-workflow' of github.com:14Ri…
14Richa Jul 27, 2023
093d749
Merge branch 'master' into 14Richa/update-maintainers-workflow
KhudaDad414 Jul 27, 2023
8b1ab9e
minor fixes
14Richa Aug 18, 2023
84c9280
Merge branch '14Richa/update-maintainers-workflow' of github.com:14Ri…
14Richa Aug 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor fixes
14Richa committed Aug 18, 2023
commit 8b1ab9e1dd6d1420f5381c7ec609f6e273ab1712
28 changes: 17 additions & 11 deletions .github/workflows/update-maintainers.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Update MAINTAINERS.yaml in community repo

on:
pull_request:
types: [closed]
push:
branches:
- master
paths:
- 'CODEOWNERS'

jobs:
update-maintainers:
if: github.event.pull_request.merged
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout main branch
uses: actions/checkout@v3
@@ -31,7 +32,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: asyncapi/community
token: ${{ secrets.GH_TOKEN}}
token: ${{ env.GITHUB_TOKEN }}
path: community

- name: Setup Node.js
@@ -45,7 +46,7 @@ jobs:
- name: Compare CODEOWNERS
id: compare-codeowners
env:
14Richa marked this conversation as resolved.
Show resolved Hide resolved
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
uses: actions/github-script@v6
with:
script: |
@@ -94,16 +95,19 @@ jobs:
continue; // Skip the iteration for bot accounts
}

const maintainer = maintainers.find(maintainer => maintainer.github === username);
const maintainer = maintainers.find(maintainer => maintainer.github === username.toLowerCase());
if (!maintainer) {
const { data } = await github.rest.users.getByUsername({ username });
const twitterUsername = data.twitter_username;
maintainers.push({
const newMaintainer = {
github: username,
twitter: twitterUsername,
isTscMember: false,
repos: [repoName]
});
};
if (twitterUsername) {
newMaintainer.twitter = twitterUsername;
}
maintainers.push(newMaintainer);
core.info('Added maintainer:', username);
} else {
// If the maintainer already exists, check if the current repo is in their list
@@ -151,9 +155,11 @@ jobs:
- name: Commit and push
working-directory: ./community
run: |
git config --global user.email "[email protected]"
git config --global user.name "asyncapi-bot"
git add .
git commit -m "Update MAINTAINERS.yaml"
git push https://${{ secrets.GH_TOKEN}}@github.com/asyncapi/community update-maintainers-${{ github.run_id }}
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/community

- name: Create PR
working-directory: ./community