Skip to content

Commit dead6be

Browse files
authored
ci: update generic workflows (#125)
1 parent 1ab0566 commit dead6be

7 files changed

+397
-405
lines changed

.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
name: Label PRs # if proper comment added
99

10-
on:
11-
issue_comment:
12-
types:
13-
- created
10+
on:
11+
issue_comment:
12+
types:
13+
- created
1414

1515
jobs:
1616
add-ready-to-merge-label:
17-
if: >
17+
if: >
1818
github.event.issue.pull_request &&
1919
github.event.issue.state != 'closed' &&
2020
github.actor != 'asyncapi-bot' &&
@@ -25,7 +25,6 @@ jobs:
2525
2626
runs-on: ubuntu-latest
2727
steps:
28-
2928
- name: Add ready-to-merge label
3029
uses: actions/github-script@v5
3130
with:
@@ -64,7 +63,7 @@ jobs:
6463
Thanks 😄`
6564
})
6665
}
67-
66+
6867
add-do-not-merge-label:
6968
if: >
7069
github.event.issue.pull_request &&
@@ -86,7 +85,7 @@ jobs:
8685
owner: context.repo.owner,
8786
repo: context.repo.repo,
8887
labels: ['do-not-merge']
89-
})
88+
})
9089
add-autoupdate-label:
9190
if: >
9291
github.event.issue.pull_request &&
@@ -108,4 +107,4 @@ jobs:
108107
owner: context.repo.owner,
109108
repo: context.repo.repo,
110109
labels: ['autoupdate']
111-
})
110+
})

.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@ jobs:
2222
script: |
2323
const labelToRemove = 'ready-to-merge';
2424
const labels = context.payload.pull_request.labels;
25-
2625
const isLabelPresent = labels.some(label => label.name === labelToRemove)
27-
2826
if(!isLabelPresent) return;
29-
3027
github.rest.issues.removeLabel({
3128
issue_number: context.issue.number,
3229
owner: context.repo.owner,
3330
repo: context.repo.repo,
3431
name: labelToRemove
35-
})
32+
})

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

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
name: Notify slack
66

77
on:
8-
98
issues:
109
types: [opened, reopened]
1110

@@ -16,57 +15,56 @@ on:
1615
types: [created]
1716

1817
jobs:
18+
issue:
19+
if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
20+
name: Notify slack on every new issue
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Convert markdown to slack markdown for issue
24+
uses: LoveToKnow/[email protected]
25+
id: issuemarkdown
26+
with:
27+
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
28+
- name: Send info about issue
29+
uses: rtCamp/action-slack-notify@v2
30+
env:
31+
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
32+
SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛
33+
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
34+
MSG_MINIMAL: true
1935

20-
issue:
21-
if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
22-
name: Notify slack on every new issue
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Convert markdown to slack markdown for issue
26-
uses: LoveToKnow/[email protected]
27-
id: issuemarkdown
28-
with:
29-
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
30-
- name: Send info about issue
31-
uses: rtCamp/action-slack-notify@v2
32-
env:
33-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
34-
SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛
35-
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
36-
MSG_MINIMAL: true
36+
pull_request:
37+
if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
38+
name: Notify slack on every new pull request
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Convert markdown to slack markdown for pull request
42+
uses: LoveToKnow/[email protected]
43+
id: prmarkdown
44+
with:
45+
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
46+
- name: Send info about pull request
47+
uses: rtCamp/action-slack-notify@v2
48+
env:
49+
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
50+
SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪
51+
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
52+
MSG_MINIMAL: true
3753

38-
pull_request:
39-
if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
40-
name: Notify slack on every new pull request
41-
runs-on: ubuntu-latest
42-
steps:
43-
- name: Convert markdown to slack markdown for pull request
44-
uses: LoveToKnow/[email protected]
45-
id: prmarkdown
46-
with:
47-
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
48-
- name: Send info about pull request
49-
uses: rtCamp/action-slack-notify@v2
50-
env:
51-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
52-
SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪
53-
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
54-
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: Notify slack 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/[email protected]
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 in ${{github.repository}} 💬
71-
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
72-
MSG_MINIMAL: true
54+
discussion:
55+
if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
56+
name: Notify slack on every new pull request
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Convert markdown to slack markdown for pull request
60+
uses: LoveToKnow/[email protected]
61+
id: discussionmarkdown
62+
with:
63+
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
64+
- name: Send info about pull request
65+
uses: rtCamp/action-slack-notify@v2
66+
env:
67+
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
68+
SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬
69+
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
70+
MSG_MINIMAL: true

.github/workflows/link-check-cron.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,30 @@ on:
88
schedule:
99
# At 00:00 UTC on every Monday
1010
- cron: '0 0 * * 0'
11-
11+
1212
jobs:
1313
External-link-validation-weekly:
1414
if: startsWith(github.repository, 'asyncapi/')
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v3
18+
19+
# Checks the status of hyperlinks in .md files
20+
- name: Check links
21+
uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons
22+
with:
23+
use-quiet-mode: 'yes'
24+
use-verbose-mode: 'yes'
1825

19-
# Checks the status of hyperlinks in .md files
20-
- name: Check links
21-
uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons
22-
with:
23-
use-quiet-mode: 'yes'
24-
use-verbose-mode: 'yes'
25-
26-
# A configuration file can be included, indicating the properties of the link check action
27-
# More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format
28-
# Create mlc_config.json file in the root of the directory
26+
# A configuration file can be included, indicating the properties of the link check action
27+
# More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format
28+
# Create mlc_config.json file in the root of the directory
2929

30-
- name: Report workflow run status to Slack
31-
uses: 8398a7/action-slack@v3
32-
with:
33-
status: ${{ job.status }}
34-
fields: repo,action,workflow
35-
env:
30+
- name: Report workflow run status to Slack
31+
uses: 8398a7/action-slack@v3
32+
with:
33+
status: ${{ job.status }}
34+
fields: repo,action,workflow
35+
env:
3636
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
37-
if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
37+
if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel

.github/workflows/link-check-pr.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
name: Check Markdown links
55

6-
on:
6+
on:
77
pull_request_target:
88
types: [synchronize, ready_for_review, opened, reopened]
99
paths:
@@ -13,15 +13,16 @@ jobs:
1313
External-link-validation-on-PR:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Checkout repo
17-
uses: actions/checkout@v3
18-
- name: Check links
19-
uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons
20-
with:
21-
use-quiet-mode: 'yes'
22-
use-verbose-mode: 'yes'
23-
check-modified-files-only: 'yes' # Only modified files are checked on PRs
24-
25-
# A configuration file can be included, indicating the properties of the link check action
26-
# More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format
27-
# Create mlc_config.json file in the root of the directory
16+
- name: Checkout repo
17+
uses: actions/checkout@v3
18+
- name: Check links
19+
uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons
20+
with:
21+
use-quiet-mode: 'yes'
22+
use-verbose-mode: 'yes'
23+
check-modified-files-only: 'yes' # Only modified files are checked on PRs
24+
25+
26+
# A configuration file can be included, indicating the properties of the link check action
27+
# More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format
28+
# Create mlc_config.json file in the root of the directory
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
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
33

4-
5-
64
name: Lint PR title
75

86
on:
97
pull_request_target:
108
types: [opened, reopened, synchronize, edited, ready_for_review]
11-
9+
1210
jobs:
1311
lint-pr-title:
14-
name: Lint PR title
15-
runs-on: ubuntu-latest
16-
steps:
12+
name: Lint PR title
13+
runs-on: ubuntu-latest
14+
steps:
1715
# 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.
1816
- if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor) }}
19-
uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 #version 4.6.0
17+
uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 #version 4.6.0
2018
id: lint_pr_title
2119
env:
2220
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
2321
with:
2422
subjectPattern: ^(?![A-Z]).+$
2523
subjectPatternError: |
2624
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character.
27-
28-
# Comments the error message from the above lint_pr_title action
25+
26+
# Comments the error message from the above lint_pr_title action
2927
- if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor)}}
3028
name: Comment on PR
31-
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2
29+
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2
3230
with:
3331
header: pr-title-lint-error
3432
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
3533
message: |
36-
37-
We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
38-
More details 👇🏼
39-
```
40-
${{ steps.lint_pr_title.outputs.error_message}}
41-
```
42-
# deletes the error comment if the title is correct
34+
35+
We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
36+
More details 👇🏼
37+
```
38+
${{ steps.lint_pr_title.outputs.error_message}}
39+
```
40+
# deletes the error comment if the title is correct
4341
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
4442
name: delete the comment
45-
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2
46-
with:
43+
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2
44+
with:
4745
header: pr-title-lint-error
4846
delete: true
4947
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}

0 commit comments

Comments
 (0)