Skip to content

Commit

Permalink
Merge branch 'master' into alequetzalli-add-CODEOWNERS-file
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Oct 15, 2021
2 parents b68e487 + 74f87d3 commit 7a8757b
Show file tree
Hide file tree
Showing 15 changed files with 455 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issues-prs-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
types: [opened, reopened, ready_for_review]

discussion:
types: [opened]
types: [created]

jobs:

Expand Down
108 changes: 79 additions & 29 deletions .github/workflows/welcome-first-time-contrib.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,84 @@
#This action is centrally managed in https://github.com/asyncapi/.github/
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo

#########
#disabled because of https://github.com/asyncapi/.github/issues/73
#########
name: Welcome first time contributors

# name: Welcome first time contributors
on:
pull_request_target:
types:
- opened
issues:
types:
- opened

# on:
# pull_request_target:
# types:
# - opened
# issues:
# types:
# - opened

# jobs:
# welcome:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/first-interaction@v1
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# issue-message: |
# Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.

# Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).


# pr-message: |
# Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.

# Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
if (!issueMessage && !prMessage) {
throw new Error('Action must have at least one of issue-message or pr-message set');
}
const isIssue = !!context.payload.issue;
let isFirstContribution;
if (isIssue) {
const query = `query($owner:String!, $name:String!, $contributer:String!) {
repository(owner:$owner, name:$name){
//since we are reading only totalCount there is no need to fetch more than 1.
issues(first: 1, filterBy: {createdBy:$contributer}){
totalCount
}
}
}`;
const variables = {
owner: context.repo.owner,
name: context.repo.repo,
contributer: context.payload.sender.login
};
const { repository: { issues: { totalCount } } } = await github.graphql(query, variables);
isFirstContribution = totalCount === 1;
} else {
const query = `query($qstr: String!) {
search(query: $qstr, type: ISSUE, first: 1) {
issueCount
}
}`;
const variables = {
"qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`,
};
const { search: { issueCount } } = await github.graphql(query, variables);
isFirstContribution = issueCount === 1;
}
if (!isFirstContribution) {
console.log(`Not the users first contribution.`);
return;
}
const message = isIssue ? issueMessage : prMessage;
// Add a comment to the appropriate place
if (isIssue) {
const issueNumber = context.payload.issue.number;
console.log(`Adding message: ${message} to issue #${issueNumber}`);
await github.issues.createComment({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
issue_number: issueNumber,
body: message
});
}
else {
const pullNumber = context.payload.pull_request.number;
console.log(`Adding message: ${message} to pull request #${pullNumber}`);
await github.pulls.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: pullNumber,
body: message,
event: 'COMMENT'
});
}
1 change: 1 addition & 0 deletions components/navigation/communityItems.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion config/TSC_MEMBERS.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,13 @@
"repos": [
"simulator"
]
},
{
"github": "anandsunderraman",
"linkedin": "anand-sunderraman-a6b7a131",
"availableForHire": false,
"repos": [
"go-watermill-template"
]
}
]
]
9 changes: 9 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@ const withMDX = require('@next/mdx')({
})
module.exports = withMDX({
pageExtensions: ['js', 'md'],
webpack(config, { isServer }) {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
fs: 'empty'
}
}
return config
},
})
74 changes: 69 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/asyncapi/website#readme",
"dependencies": {
"@asyncapi/modelina": "^0.31.3",
"@asyncapi/modelina": "^0.39.0",
"@fec/remark-a11y-emoji": "^1.0.0",
"@fullhuman/postcss-purgecss": "^2.2.0",
"@mdx-js/loader": "^1.6.4",
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/hacktoberfest-summary-2020.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ date: 2020-11-05T06:00:00+01:00
type: Community
tags:
- Hacktoberfest
cover: /img/pots/hacktoberfest-summary-2020/cover.webp
cover: /img/posts/hacktoberfest-summary-2020/cover.webp
authors:
- name: Lukasz Gornicki
photo: /img/avatars/lpgornicki.webp
Expand Down
Loading

0 comments on commit 7a8757b

Please sign in to comment.