Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
132 changes: 66 additions & 66 deletions .github/workflows/automerge-orphans.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
# 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

name: 'Notify on failing automerge'

on:
schedule:
- cron: "0 0 * * *"

jobs:
identify-orphans:
if: startsWith(github.repository, 'asyncapi/')
name: Find orphans and notify
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get list of orphans
uses: actions/github-script@v7
id: orphans
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const query = `query($owner:String!, $name:String!) {
repository(owner:$owner, name:$name){
pullRequests(first: 100, states: OPEN){
nodes{
title
url
author {
resourcePath
}
}
}
}
}`;
const variables = {
owner: context.repo.owner,
name: context.repo.repo
};
const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables);

let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot')

if (orphans.length) {
core.setOutput('found', 'true');
//Yes, this is very naive approach to assume there is just one PR causing issues, there can be a case that more PRs are affected the same day
//The thing is that handling multiple PRs will increase a complexity in this PR that in my opinion we should avoid
//The other PRs will be reported the next day the action runs, or person that checks first url will notice the other ones
core.setOutput('url', orphans[0].url);
core.setOutput('title', orphans[0].title);
}
- if: steps.orphans.outputs.found == 'true'
name: Convert markdown to slack markdown
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: issuemarkdown
with:
markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"
- if: steps.orphans.outputs.found == 'true'
name: Send info about orphan to slack
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}}
SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
# 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
name: 'Notify on failing automerge'
on:
schedule:
- cron: "0 0 * * *"
jobs:
identify-orphans:
if: startsWith(github.repository, 'asyncapi/')
name: Find orphans and notify
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get list of orphans
uses: actions/github-script@v7
id: orphans
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const query = `query($owner:String!, $name:String!) {
repository(owner:$owner, name:$name){
pullRequests(first: 100, states: OPEN){
nodes{
title
url
author {
resourcePath
}
}
}
}
}`;
const variables = {
owner: context.repo.owner,
name: context.repo.repo
};
const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables);
let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot')
if (orphans.length) {
core.setOutput('found', 'true');
//Yes, this is very naive approach to assume there is just one PR causing issues, there can be a case that more PRs are affected the same day
//The thing is that handling multiple PRs will increase a complexity in this PR that in my opinion we should avoid
//The other PRs will be reported the next day the action runs, or person that checks first url will notice the other ones
core.setOutput('url', orphans[0].url);
core.setOutput('title', orphans[0].title);
}
- if: steps.orphans.outputs.found == 'true'
name: Convert markdown to slack markdown
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: issuemarkdown
with:
markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"
- if: steps.orphans.outputs.found == 'true'
name: Send info about orphan to slack
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}}
SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true
170 changes: 85 additions & 85 deletions .github/workflows/issues-prs-notifications.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
# 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

# This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository
name: Notify slack

on:
issues:
types: [opened, reopened]

pull_request_target:
types: [opened, reopened, ready_for_review]

discussion:
types: [created]

jobs:
issue:
if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Notify slack on every new issue
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown for issue
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: issuemarkdown
env:
ISSUE_TITLE: ${{github.event.issue.title}}
ISSUE_URL: ${{github.event.issue.html_url}}
ISSUE_BODY: ${{github.event.issue.body}}
with:
markdown: "[${{ env.ISSUE_TITLE }}](${{ env.ISSUE_URL }}) \n ${{ env.ISSUE_BODY }}"
- name: Send info about issue
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true

pull_request:
if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Notify slack on every new pull request
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown for pull request
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: prmarkdown
env:
PR_TITLE: ${{github.event.pull_request.title}}
PR_URL: ${{github.event.pull_request.html_url}}
PR_BODY: ${{github.event.pull_request.body}}
with:
markdown: "[${{ env.PR_TITLE }}](${{ env.PR_URL }}) \n ${{ env.PR_BODY }}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
MSG_MINIMAL: true

discussion:
if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Notify slack on every new pull request
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown for pull request
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: discussionmarkdown
env:
DISCUSSION_TITLE: ${{github.event.discussion.title}}
DISCUSSION_URL: ${{github.event.discussion.html_url}}
DISCUSSION_BODY: ${{github.event.discussion.body}}
with:
markdown: "[${{ env.DISCUSSION_TITLE }}](${{ env.DISCUSSION_URL }}) \n ${{ env.DISCUSSION_BODY }}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
MSG_MINIMAL: true
# 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
# This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository
name: Notify slack
on:
issues:
types: [opened, reopened]
pull_request_target:
types: [opened, reopened, ready_for_review]
discussion:
types: [created]
jobs:
issue:
if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Notify slack on every new issue
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown for issue
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: issuemarkdown
env:
ISSUE_TITLE: ${{github.event.issue.title}}
ISSUE_URL: ${{github.event.issue.html_url}}
ISSUE_BODY: ${{github.event.issue.body}}
with:
markdown: "[${{ env.ISSUE_TITLE }}](${{ env.ISSUE_URL }}) \n ${{ env.ISSUE_BODY }}"
- name: Send info about issue
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true
pull_request:
if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Notify slack on every new pull request
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown for pull request
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: prmarkdown
env:
PR_TITLE: ${{github.event.pull_request.title}}
PR_URL: ${{github.event.pull_request.html_url}}
PR_BODY: ${{github.event.pull_request.body}}
with:
markdown: "[${{ env.PR_TITLE }}](${{ env.PR_URL }}) \n ${{ env.PR_BODY }}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
MSG_MINIMAL: true
discussion:
if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
name: Notify slack on every new pull request
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown for pull request
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
id: discussionmarkdown
env:
DISCUSSION_TITLE: ${{github.event.discussion.title}}
DISCUSSION_URL: ${{github.event.discussion.html_url}}
DISCUSSION_BODY: ${{github.event.discussion.body}}
with:
markdown: "[${{ env.DISCUSSION_TITLE }}](${{ env.DISCUSSION_URL }}) \n ${{ env.DISCUSSION_BODY }}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
MSG_MINIMAL: true
Loading
Loading