Skip to content

Commit 6868897

Browse files
asyncapi-botasyncapi-botasyncapi-bot-eve
authored
ci: update generic workflows (#749)
Co-authored-by: asyncapi-bot <[email protected]> Co-authored-by: asyncapi-bot-eve <[email protected]>
1 parent e20fcd2 commit 6868897

14 files changed

+173
-162
lines changed

.github/workflows/add-good-first-issue-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Add label
18-
uses: actions/github-script@v5
18+
uses: actions/github-script@v6
1919
with:
2020
github-token: ${{ secrets.GH_TOKEN }}
2121
script: |

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Add ready-to-merge label
29-
uses: actions/github-script@v5
29+
uses: actions/github-script@v6
3030
with:
3131
github-token: ${{ secrets.GH_TOKEN }}
3232
script: |
@@ -76,7 +76,7 @@ jobs:
7676
runs-on: ubuntu-latest
7777
steps:
7878
- name: Add do-not-merge label
79-
uses: actions/github-script@v5
79+
uses: actions/github-script@v6
8080
with:
8181
github-token: ${{ secrets.GH_TOKEN }}
8282
script: |
@@ -98,7 +98,7 @@ jobs:
9898
runs-on: ubuntu-latest
9999
steps:
100100
- name: Add autoupdate label
101-
uses: actions/github-script@v5
101+
uses: actions/github-script@v6
102102
with:
103103
github-token: ${{ secrets.GH_TOKEN }}
104104
script: |

.github/workflows/automerge-for-humans-merging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
| join("\n")'
4444
multiline: true
4545
- name: Automerge PR
46-
uses: pascalgn/automerge-action@v0.14.3
46+
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6
4747
env:
4848
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
4949
MERGE_LABELS: "!do-not-merge,ready-to-merge"

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Remove label
19-
uses: actions/github-script@v5
19+
uses: actions/github-script@v6
2020
with:
2121
github-token: ${{ secrets.GH_TOKEN }}
2222
script: |

.github/workflows/automerge-orphans.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ jobs:
1313
name: Find orphans and notify
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
1618
- name: Get list of orphans
17-
uses: actions/github-script@v3
19+
uses: actions/github-script@v6
1820
id: orphans
1921
with:
2022
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -50,10 +52,10 @@ jobs:
5052
}
5153
- if: steps.orphans.outputs.found == 'true'
5254
name: Convert markdown to slack markdown
53-
uses: LoveToKnow/slackify-markdown[email protected]
55+
uses: asyncapi/.github/.github/actions/slackify-markdown@master
5456
id: issuemarkdown
5557
with:
56-
text: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"
58+
markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"
5759
- if: steps.orphans.outputs.found == 'true'
5860
name: Send info about orphan to slack
5961
uses: rtCamp/action-slack-notify@v2

.github/workflows/automerge.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Autoapproving
22-
uses: hmarr/auto-approve-action@v2
22+
uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1 is used https://github.com/hmarr/auto-approve-action/releases/tag/v3.2.1
2323
with:
2424
github-token: "${{ secrets.GH_TOKEN_BOT_EVE }}"
2525

2626
- name: Label autoapproved
27-
uses: actions/github-script@v5
27+
uses: actions/github-script@v6
2828
with:
2929
github-token: ${{ secrets.GH_TOKEN }}
3030
script: |
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
steps:
4343
- name: Automerging
44-
uses: pascalgn/automerge-action@v0.13.0
44+
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6
4545
env:
4646
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
4747
GITHUB_LOGIN: asyncapi-bot

.github/workflows/help-command.yml

+38-22
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,48 @@ jobs:
1313
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions-ecosystem/action-create-comment@v1
16+
- name: Add comment to PR
17+
uses: actions/github-script@v6
1718
with:
18-
github_token: ${{ secrets.GH_TOKEN }}
19-
body: |
20-
Hello, @${{ github.actor }}! 👋🏼
19+
github-token: ${{ secrets.GH_TOKEN }}
20+
script: |
21+
//Yes to add comment to PR the same endpoint is use that we use to create a comment in issue
22+
//For more details http://developer.github.com/v3/issues/comments/
23+
//Also proved by this action https://github.com/actions-ecosystem/action-create-comment/blob/main/src/main.ts
24+
github.rest.issues.createComment({
25+
issue_number: context.issue.number,
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
body: `Hello, @${{ github.actor }}! 👋🏼
29+
30+
I'm Genie from the magic lamp. Looks like somebody needs a hand! 🆘
31+
32+
At the moment the following comments are supported in pull requests:
33+
34+
- `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
35+
- `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
36+
- `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.`
37+
})
2138

22-
I'm Genie from the magic lamp. Looks like somebody needs a hand! 🆘
23-
24-
At the moment the following comments are supported in pull requests:
25-
26-
- `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
27-
- `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
28-
- `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.
2939
create_help_comment_issue:
3040
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
3141
runs-on: ubuntu-latest
3242
steps:
33-
- uses: actions-ecosystem/action-create-comment@v1
43+
- name: Add comment to Issue
44+
uses: actions/github-script@v6
3445
with:
35-
github_token: ${{ secrets.GH_TOKEN }}
36-
body: |
37-
Hello, @${{ github.actor }}! 👋🏼
38-
39-
I'm Genie from the magic lamp. Looks like somebody needs a hand! 🆘
40-
41-
At the moment the following comments are supported in issues:
42-
43-
- `/good-first-issue {js | ts | java | go | docs | design | ci-cd} ` or `/gfi {js | ts | java | go | docs | design | ci-cd} ` - label an issue as a `good first issue`.
44-
example: `/gfi js` or `/good-first-issue ci-cd`
46+
github-token: ${{ secrets.GH_TOKEN }}
47+
script: |
48+
github.rest.issues.createComment({
49+
issue_number: context.issue.number,
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
body: `Hello, @${{ github.actor }}! 👋🏼
53+
54+
I'm Genie from the magic lamp. Looks like somebody needs a hand! 🆘
55+
56+
At the moment the following comments are supported in issues:
57+
58+
- `/good-first-issue {js | ts | java | go | docs | design | ci-cd} ` or `/gfi {js | ts | java | go | docs | design | ci-cd} ` - label an issue as a `good first issue`.
59+
example: `/gfi js` or `/good-first-issue ci-cd`
60+
})

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

+12-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ jobs:
2020
name: Notify slack on every new issue
2121
runs-on: ubuntu-latest
2222
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
2325
- name: Convert markdown to slack markdown for issue
24-
uses: LoveToKnow/slackify-markdown[email protected]
26+
uses: asyncapi/.github/.github/actions/slackify-markdown@master
2527
id: issuemarkdown
2628
with:
27-
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
29+
markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
2830
- name: Send info about issue
2931
uses: rtCamp/action-slack-notify@v2
3032
env:
@@ -38,11 +40,13 @@ jobs:
3840
name: Notify slack on every new pull request
3941
runs-on: ubuntu-latest
4042
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v3
4145
- name: Convert markdown to slack markdown for pull request
42-
uses: LoveToKnow/slackify-markdown[email protected]
46+
uses: asyncapi/.github/.github/actions/slackify-markdown@master
4347
id: prmarkdown
4448
with:
45-
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
49+
markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
4650
- name: Send info about pull request
4751
uses: rtCamp/action-slack-notify@v2
4852
env:
@@ -56,11 +60,13 @@ jobs:
5660
name: Notify slack on every new pull request
5761
runs-on: ubuntu-latest
5862
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@v3
5965
- name: Convert markdown to slack markdown for pull request
60-
uses: LoveToKnow/slackify-markdown[email protected]
66+
uses: asyncapi/.github/.github/actions/slackify-markdown@master
6167
id: discussionmarkdown
6268
with:
63-
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
69+
markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
6470
- name: Send info about pull request
6571
uses: rtCamp/action-slack-notify@v2
6672
env:

.github/workflows/lint-pr-title.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
# 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.
16-
- if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor) }}
17-
uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 #version 4.6.0
16+
- if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }}
17+
uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 #version 5.2.0 https://github.com/amannn/action-semantic-pull-request/releases/tag/v5.2.0
1818
id: lint_pr_title
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
@@ -24,9 +24,9 @@ jobs:
2424
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character.
2525
2626
# Comments the error message from the above lint_pr_title action
27-
- if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor)}}
27+
- if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor)}}
2828
name: Comment on PR
29-
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2
29+
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0
3030
with:
3131
header: pr-title-lint-error
3232
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
@@ -40,7 +40,7 @@ jobs:
4040
# deletes the error comment if the title is correct
4141
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
4242
name: delete the comment
43-
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2
43+
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0
4444
with:
4545
header: pr-title-lint-error
4646
delete: true

0 commit comments

Comments
 (0)