Skip to content

Commit

Permalink
Merge branch 'master' into removemaintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Sep 11, 2023
2 parents b2ae432 + 8197f0a commit 913bfec
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 273 deletions.
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
Expand All @@ -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
Expand All @@ -45,7 +46,7 @@ jobs:
- name: Compare CODEOWNERS
id: compare-codeowners
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
uses: actions/github-script@v6
with:
script: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.

* @fmvilas @derberg @magicmatatjahu @jonaslagoni @asyncapi-bot-eve
* @derberg @magicmatatjahu @jonaslagoni @asyncapi-bot-eve

# All .md files
*.md @Florence-Njeri @derberg @asyncapi-bot-eve
2 changes: 1 addition & 1 deletion docs/generator_template.md → docs/generator-template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Creating a Generator template"
title: "Creating a template"
weight: 170
---

Expand Down
2 changes: 2 additions & 0 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { Parser, convertToOldAPI } = require('@asyncapi/parser/cjs');
const { OpenAPISchemaParser } = require('@asyncapi/openapi-schema-parser');
const { AvroSchemaParser } = require('@asyncapi/avro-schema-parser');
const { RamlDTSchemaParser } = require('@asyncapi/raml-dt-schema-parser');
const { ProtoBuffSchemaParser } = require('@asyncapi/protobuf-schema-parser');

const parser = module.exports;

Expand All @@ -12,6 +13,7 @@ const defaultParser = new Parser({
OpenAPISchemaParser(),
AvroSchemaParser(),
RamlDTSchemaParser(),
ProtoBuffSchemaParser(),
],
});

Expand Down
Loading

0 comments on commit 913bfec

Please sign in to comment.