Skip to content

Commit 8a17451

Browse files
authored
ci: update global workflows
1 parent ec91b14 commit 8a17451

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

.github/workflows/automerge-orphans.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ jobs:
2020
script: |
2121
const query = `query($owner:String!, $name:String!) {
2222
repository(owner:$owner, name:$name){
23-
pullRequests(first: 100){
23+
pullRequests(first: 100, states: OPEN){
2424
nodes{
2525
title
2626
url
2727
author {
2828
resourcePath
2929
}
30-
state
3130
}
3231
}
3332
}
@@ -38,13 +37,7 @@ jobs:
3837
};
3938
const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables);
4039
41-
let orphans = nodes.filter((pr)=> {
42-
console.log('PR', pr.url);
43-
console.log('State', pr.state);
44-
console.log('Author resource path', pr.author.resourcePath);
45-
console.log('Is orphan', pr.state === 'OPEN' && (pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot'));
46-
return pr.state === 'OPEN' && (pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot')
47-
})
40+
let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot')
4841
4942
if (orphans.length) {
5043
core.setOutput('found', 'true');

.github/workflows/bump.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
2525
- if: steps.packagejson.outputs.exists == 'true' && startsWith(github.event.commits[0].message, 'chore(release):')
2626
name: Bumping latest version of this package in other repositories
27-
uses: derberg/custom-dependabot-for-your-github-org@v2
27+
uses: derberg/npm-dependency-manager-for-your-github-org@v3
2828
with:
2929
github_token: ${{ secrets.GH_TOKEN }}
3030
committer_username: asyncapi-bot
3131
committer_email: info@asyncapi.io
32-
repos_to_ignore: html-template #this is temporary until react component releases 1.0, then it can be removed
32+
repos_to_ignore: html-template #this is temporary until react component releases 1.0, then it can be removed

.github/workflows/issues-prs-notifications.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#This action is centrally managed in https://github.com/asyncapi/.github/
22
#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
3+
4+
#This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository
35
name: Notify slack
46

57
on:
@@ -10,6 +12,9 @@ on:
1012
pull_request_target:
1113
types: [opened, reopened, ready_for_review]
1214

15+
discussion:
16+
types: [opened]
17+
1318
jobs:
1419

1520
issue:
@@ -47,3 +52,21 @@ jobs:
4752
SLACK_TITLE: 💪 New Pull Request 💪
4853
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
4954
MSG_MINIMAL: true
55+
56+
discussion:
57+
if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
58+
name: On every new pull request
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Convert markdown to slack markdown for pull request
62+
uses: LoveToKnow/slackify-markdown-action@v1.0.0
63+
id: discussionmarkdown
64+
with:
65+
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
66+
- name: Send info about pull request
67+
uses: rtCamp/action-slack-notify@v2
68+
env:
69+
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
70+
SLACK_TITLE: 💬 New Discussion 💬
71+
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
72+
MSG_MINIMAL: true

0 commit comments

Comments
 (0)