From 59b52521d1a186ddc8255f19b969f70bafd6786f Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 9 Nov 2022 18:28:33 +0000 Subject: [PATCH] ci: update generic workflows --- ...d-ready-to-merge-or-do-not-merge-label.yml | 17 +- ...ns-remove-ready-to-merge-label-on-edit.yml | 5 +- .../workflows/issues-prs-notifications.yml | 104 ++-- .github/workflows/link-check-cron.yml | 38 +- .github/workflows/link-check-pr.yml | 27 +- .github/workflows/lint-pr-title.yml | 36 +- .../workflows/notify-tsc-members-mention.yml | 575 +++++++++--------- 7 files changed, 397 insertions(+), 405 deletions(-) diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml index e00a45fa..79c8079e 100644 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml @@ -7,14 +7,14 @@ name: Label PRs # if proper comment added -on: - issue_comment: - types: - - created +on: + issue_comment: + types: + - created jobs: add-ready-to-merge-label: - if: > + if: > github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot' && @@ -25,7 +25,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Add ready-to-merge label uses: actions/github-script@v5 with: @@ -64,7 +63,7 @@ jobs: Thanks 😄` }) } - + add-do-not-merge-label: if: > github.event.issue.pull_request && @@ -86,7 +85,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, labels: ['do-not-merge'] - }) + }) add-autoupdate-label: if: > github.event.issue.pull_request && @@ -108,4 +107,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, labels: ['autoupdate'] - }) + }) diff --git a/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml b/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml index f38296c8..b8fc9904 100644 --- a/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml +++ b/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml @@ -22,14 +22,11 @@ jobs: script: | const labelToRemove = 'ready-to-merge'; const labels = context.payload.pull_request.labels; - const isLabelPresent = labels.some(label => label.name === labelToRemove) - if(!isLabelPresent) return; - github.rest.issues.removeLabel({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, name: labelToRemove - }) + }) diff --git a/.github/workflows/issues-prs-notifications.yml b/.github/workflows/issues-prs-notifications.yml index 576b2bac..ca665404 100644 --- a/.github/workflows/issues-prs-notifications.yml +++ b/.github/workflows/issues-prs-notifications.yml @@ -5,7 +5,6 @@ name: Notify slack on: - issues: types: [opened, reopened] @@ -16,57 +15,56 @@ on: 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 + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: issuemarkdown + with: + text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" + - name: Send info about issue + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} + SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛 + SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} + MSG_MINIMAL: true - 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 - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: issuemarkdown - with: - text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" - - name: Send info about issue - uses: rtCamp/action-slack-notify@v2 - 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 + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: prmarkdown + with: + text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" + - name: Send info about pull request + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} + SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪 + SLACK_MESSAGE: ${{steps.prmarkdown.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 - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: prmarkdown - with: - text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" - - name: Send info about pull request - uses: rtCamp/action-slack-notify@v2 - 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 - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: discussionmarkdown - with: - text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" - - name: Send info about pull request - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} - SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬 - SLACK_MESSAGE: ${{steps.discussionmarkdown.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 + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: discussionmarkdown + with: + text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" + - name: Send info about pull request + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} + SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬 + SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} + MSG_MINIMAL: true diff --git a/.github/workflows/link-check-cron.yml b/.github/workflows/link-check-cron.yml index e992e2d6..873d4297 100644 --- a/.github/workflows/link-check-cron.yml +++ b/.github/workflows/link-check-cron.yml @@ -8,30 +8,30 @@ on: schedule: # At 00:00 UTC on every Monday - cron: '0 0 * * 0' - + jobs: External-link-validation-weekly: if: startsWith(github.repository, 'asyncapi/') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + + # Checks the status of hyperlinks in .md files + - name: Check links + uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' - # Checks the status of hyperlinks in .md files - - name: Check links - uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - - # A configuration file can be included, indicating the properties of the link check action - # More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format - # Create mlc_config.json file in the root of the directory + # A configuration file can be included, indicating the properties of the link check action + # More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format + # Create mlc_config.json file in the root of the directory - - name: Report workflow run status to Slack - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,action,workflow - env: + - name: Report workflow run status to Slack + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + fields: repo,action,workflow + env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel + if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel diff --git a/.github/workflows/link-check-pr.yml b/.github/workflows/link-check-pr.yml index deb425cb..51f6cf78 100644 --- a/.github/workflows/link-check-pr.yml +++ b/.github/workflows/link-check-pr.yml @@ -3,7 +3,7 @@ name: Check Markdown links -on: +on: pull_request_target: types: [synchronize, ready_for_review, opened, reopened] paths: @@ -13,15 +13,16 @@ jobs: External-link-validation-on-PR: runs-on: ubuntu-latest steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Check links - uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - check-modified-files-only: 'yes' # Only modified files are checked on PRs - - # A configuration file can be included, indicating the properties of the link check action - # More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format - # Create mlc_config.json file in the root of the directory + - name: Checkout repo + uses: actions/checkout@v3 + - name: Check links + uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' # Only modified files are checked on PRs + + + # A configuration file can be included, indicating the properties of the link check action + # More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format + # Create mlc_config.json file in the root of the directory diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index 0440d87e..c4a942a9 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -1,22 +1,20 @@ # 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: Lint PR title on: pull_request_target: types: [opened, reopened, synchronize, edited, ready_for_review] - + jobs: lint-pr-title: - name: Lint PR title - runs-on: ubuntu-latest - steps: + name: Lint PR title + runs-on: ubuntu-latest + steps: # Since this workflow is REQUIRED for a PR to be mergable, we have to have this 'if' statement in step level instead of job level. - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor) }} - uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 #version 4.6.0 + uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 #version 4.6.0 id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} @@ -24,26 +22,26 @@ jobs: subjectPattern: ^(?![A-Z]).+$ subjectPatternError: | The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. - - # Comments the error message from the above lint_pr_title action + + # Comments the error message from the above lint_pr_title action - if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor)}} name: Comment on PR - uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2 + uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2 with: header: pr-title-lint-error GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} message: | - - We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - More details 👇🏼 - ``` - ${{ steps.lint_pr_title.outputs.error_message}} - ``` - # deletes the error comment if the title is correct + + We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). + More details 👇🏼 + ``` + ${{ steps.lint_pr_title.outputs.error_message}} + ``` + # deletes the error comment if the title is correct - if: ${{ steps.lint_pr_title.outputs.error_message == null }} name: delete the comment - uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2 - with: + uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2 + with: header: pr-title-lint-error delete: true GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} diff --git a/.github/workflows/notify-tsc-members-mention.yml b/.github/workflows/notify-tsc-members-mention.yml index 1cdb371c..f7abce31 100644 --- a/.github/workflows/notify-tsc-members-mention.yml +++ b/.github/workflows/notify-tsc-members-mention.yml @@ -5,300 +5,299 @@ name: Notify slack and email subscribers whenever TSC members are mentioned in GitHub on: - issue_comment: - types: - - created - - edited - - discussion_comment: - types: - - created - - edited - - issues: - types: - - opened - - reopened + issue_comment: + types: + - created + - edited - pull_request_target: - types: - - opened - - reopened - - ready_for_review + discussion_comment: + types: + - created + - edited - discussion: - types: - - created - - edited + issues: + types: + - opened + - reopened + + pull_request_target: + types: + - opened + - reopened + - ready_for_review + + discussion: + types: + - created + - edited jobs: + issue: + if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members') + name: TSC notification on every new issue + runs-on: ubuntu-latest + steps: + ######### + # Handling Slack notifications + ######### + - name: Convert markdown to slack markdown + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: issuemarkdown + with: + text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" + - name: Send info about issue + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} + SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘 + SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} + MSG_MINIMAL: true + ######### + # Handling Mailchimp notifications + ######### + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install deps + run: npm install + working-directory: ./.github/workflows/scripts/mailchimp + - name: Send email with MailChimp + uses: actions/github-script@v4 + env: + CALENDAR_ID: ${{ secrets.CALENDAR_ID }} + CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} + MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} + with: + script: | + const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); + sendEmail('${{github.event.issue.html_url}}'); - issue: - if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members') - name: TSC notification on every new issue - runs-on: ubuntu-latest - steps: - ######### - # Handling Slack notifications - ######### - - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: issuemarkdown - with: - text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" - - name: Send info about issue - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} - SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘 - SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} - MSG_MINIMAL: true - ######### - # Handling Mailchimp notifications - ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install deps - run: npm install - working-directory: ./.github/workflows/scripts/mailchimp - - name: Send email with MailChimp - uses: actions/github-script@v4 - env: - CALENDAR_ID: ${{ secrets.CALENDAR_ID }} - CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} - MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} - with: - script: | - const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); - sendEmail('${{github.event.issue.html_url}}'); + pull_request: + if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members') + name: TSC notification on every new pull request + runs-on: ubuntu-latest + steps: + ######### + # Handling Slack notifications + ######### + - name: Convert markdown to slack markdown + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: prmarkdown + with: + text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" + - name: Send info about pull request + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} + SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘 + SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} + MSG_MINIMAL: true + ######### + # Handling Mailchimp notifications + ######### + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install deps + run: npm install + working-directory: ./.github/workflows/scripts/mailchimp + - name: Send email with MailChimp + uses: actions/github-script@v4 + env: + CALENDAR_ID: ${{ secrets.CALENDAR_ID }} + CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} + MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} + with: + script: | + const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); + sendEmail('${{github.event.pull_request.html_url}}'); - pull_request: - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members') - name: TSC notification on every new pull request - runs-on: ubuntu-latest - steps: - ######### - # Handling Slack notifications - ######### - - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: prmarkdown - with: - text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" - - name: Send info about pull request - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} - SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘 - SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} - MSG_MINIMAL: true - ######### - # Handling Mailchimp notifications - ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install deps - run: npm install - working-directory: ./.github/workflows/scripts/mailchimp - - name: Send email with MailChimp - uses: actions/github-script@v4 - env: - CALENDAR_ID: ${{ secrets.CALENDAR_ID }} - CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} - MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} - with: - script: | - const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); - sendEmail('${{github.event.pull_request.html_url}}'); - - discussion: - if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members') - name: TSC notification on every new discussion - runs-on: ubuntu-latest - steps: - ######### - # Handling Slack notifications - ######### - - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: discussionmarkdown - with: - text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" - - name: Send info about pull request - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} - SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘 - SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} - MSG_MINIMAL: true - ######### - # Handling Mailchimp notifications - ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install deps - run: npm install - working-directory: ./.github/workflows/scripts/mailchimp - - name: Send email with MailChimp - uses: actions/github-script@v4 - env: - CALENDAR_ID: ${{ secrets.CALENDAR_ID }} - CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} - MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} - with: - script: | - const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); - sendEmail('${{github.event.discussion.html_url}}'); + discussion: + if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members') + name: TSC notification on every new discussion + runs-on: ubuntu-latest + steps: + ######### + # Handling Slack notifications + ######### + - name: Convert markdown to slack markdown + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: discussionmarkdown + with: + text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" + - name: Send info about pull request + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} + SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘 + SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} + MSG_MINIMAL: true + ######### + # Handling Mailchimp notifications + ######### + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install deps + run: npm install + working-directory: ./.github/workflows/scripts/mailchimp + - name: Send email with MailChimp + uses: actions/github-script@v4 + env: + CALENDAR_ID: ${{ secrets.CALENDAR_ID }} + CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} + MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} + with: + script: | + const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); + sendEmail('${{github.event.discussion.html_url}}'); - issue_comment: - if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }} - name: TSC notification on every new comment in issue - runs-on: ubuntu-latest - steps: - ######### - # Handling Slack notifications - ######### - - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: issuemarkdown - with: - text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" - - name: Send info about issue comment - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} - SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘 - SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} - MSG_MINIMAL: true - ######### - # Handling Mailchimp notifications - ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install deps - run: npm install - working-directory: ./.github/workflows/scripts/mailchimp - - name: Send email with MailChimp - uses: actions/github-script@v4 - env: - CALENDAR_ID: ${{ secrets.CALENDAR_ID }} - CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} - MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} - with: - script: | - const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); - sendEmail('${{github.event.comment.html_url}}'); + issue_comment: + if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }} + name: TSC notification on every new comment in issue + runs-on: ubuntu-latest + steps: + ######### + # Handling Slack notifications + ######### + - name: Convert markdown to slack markdown + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: issuemarkdown + with: + text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" + - name: Send info about issue comment + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} + SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘 + SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} + MSG_MINIMAL: true + ######### + # Handling Mailchimp notifications + ######### + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install deps + run: npm install + working-directory: ./.github/workflows/scripts/mailchimp + - name: Send email with MailChimp + uses: actions/github-script@v4 + env: + CALENDAR_ID: ${{ secrets.CALENDAR_ID }} + CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} + MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} + with: + script: | + const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); + sendEmail('${{github.event.comment.html_url}}'); - pr_comment: - if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') - name: TSC notification on every new comment in pr - runs-on: ubuntu-latest - steps: - ######### - # Handling Slack notifications - ######### - - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: prmarkdown - with: - text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" - - name: Send info about PR comment - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} - SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘 - SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} - MSG_MINIMAL: true - ######### - # Handling Mailchimp notifications - ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install deps - run: npm install - working-directory: ./.github/workflows/scripts/mailchimp - - name: Send email with MailChimp - uses: actions/github-script@v4 - env: - CALENDAR_ID: ${{ secrets.CALENDAR_ID }} - CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} - MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} - with: - script: | - const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); - sendEmail('${{github.event.comment.html_url}}'); + pr_comment: + if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') + name: TSC notification on every new comment in pr + runs-on: ubuntu-latest + steps: + ######### + # Handling Slack notifications + ######### + - name: Convert markdown to slack markdown + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: prmarkdown + with: + text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" + - name: Send info about PR comment + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} + SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘 + SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} + MSG_MINIMAL: true + ######### + # Handling Mailchimp notifications + ######### + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install deps + run: npm install + working-directory: ./.github/workflows/scripts/mailchimp + - name: Send email with MailChimp + uses: actions/github-script@v4 + env: + CALENDAR_ID: ${{ secrets.CALENDAR_ID }} + CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} + MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} + with: + script: | + const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); + sendEmail('${{github.event.comment.html_url}}'); - discussion_comment: - if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members') - name: TSC notification on every new comment in discussion - runs-on: ubuntu-latest - steps: - ######### - # Handling Slack notifications - ######### - - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: discussionmarkdown - with: - text: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" - - name: Send info about discussion comment - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} - SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘 - SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} - MSG_MINIMAL: true - ######### - # Handling Mailchimp notifications - ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install deps - run: npm install - working-directory: ./.github/workflows/scripts/mailchimp - - name: Send email with MailChimp - uses: actions/github-script@v4 - env: - CALENDAR_ID: ${{ secrets.CALENDAR_ID }} - CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} - MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} - with: - script: | - const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); - sendEmail('${{github.event.comment.html_url}}'); \ No newline at end of file + discussion_comment: + if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members') + name: TSC notification on every new comment in discussion + runs-on: ubuntu-latest + steps: + ######### + # Handling Slack notifications + ######### + - name: Convert markdown to slack markdown + uses: LoveToKnow/slackify-markdown-action@v1.0.0 + id: discussionmarkdown + with: + text: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" + - name: Send info about discussion comment + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} + SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘 + SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} + MSG_MINIMAL: true + ######### + # Handling Mailchimp notifications + ######### + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install deps + run: npm install + working-directory: ./.github/workflows/scripts/mailchimp + - name: Send email with MailChimp + uses: actions/github-script@v4 + env: + CALENDAR_ID: ${{ secrets.CALENDAR_ID }} + CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} + MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} + with: + script: | + const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); + sendEmail('${{github.event.comment.html_url}}');