-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77c40b5
commit b2c64eb
Showing
7 changed files
with
397 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
# 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}} | ||
with: | ||
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}} |
Oops, something went wrong.