Skip to content

Commit e34abdc

Browse files
authored
ci: update of files from global .github repo (#212)
1 parent 6924ec7 commit e34abdc

13 files changed

+166
-63
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- name: Add ready-to-merge label
2929
uses: actions/github-script@v7
30+
env:
31+
GITHUB_ACTOR: ${{ github.actor }}
3032
with:
3133
github-token: ${{ secrets.GH_TOKEN }}
3234
script: |
@@ -56,7 +58,7 @@ jobs:
5658
issue_number: context.issue.number,
5759
owner: context.repo.owner,
5860
repo: context.repo.repo,
59-
body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ
61+
body: `Hello, @${process.env.GITHUB_ACTOR}! πŸ‘‹πŸΌ
6062
This PR is not up to date with the base branch and can't be merged.
6163
Please update your branch manually with the latest version of the base branch.
6264
PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly.

β€Ž.github/workflows/automerge-orphans.ymlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ jobs:
5252
}
5353
- if: steps.orphans.outputs.found == 'true'
5454
name: Convert markdown to slack markdown
55-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
55+
# This workflow is from our own org repo and safe to reference by 'master'.
56+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
5657
id: issuemarkdown
5758
with:
5859
markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"

β€Ž.github/workflows/bounty-program-commands.ymlβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ jobs:
3333
steps:
3434
- name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command
3535
uses: actions/github-script@v7
36+
env:
37+
ACTOR: ${{ github.actor }}
3638
with:
3739
github-token: ${{ secrets.GH_TOKEN }}
3840
script: |
39-
const commentText = `❌ @${{github.actor}} is not authorized to use the Bounty Program's commands.
41+
const commentText = `❌ @${process.env.ACTOR} is not authorized to use the Bounty Program's commands.
4042
These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`;
4143
42-
console.log(`❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command.`);
44+
console.log(`❌ @${process.env.ACTOR} made an unauthorized attempt to use a Bounty Program's command.`);
4345
github.rest.issues.createComment({
4446
issue_number: context.issue.number,
4547
owner: context.repo.owner,

β€Ž.github/workflows/help-command.ymlβ€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Add comment to PR
1717
uses: actions/github-script@v7
18+
env:
19+
ACTOR: ${{ github.actor }}
1820
with:
1921
github-token: ${{ secrets.GH_TOKEN }}
2022
script: |
@@ -25,7 +27,7 @@ jobs:
2527
issue_number: context.issue.number,
2628
owner: context.repo.owner,
2729
repo: context.repo.repo,
28-
body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ
30+
body: `Hello, @${process.env.ACTOR}! πŸ‘‹πŸΌ
2931
3032
I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!
3133
@@ -44,14 +46,16 @@ jobs:
4446
steps:
4547
- name: Add comment to Issue
4648
uses: actions/github-script@v7
49+
env:
50+
ACTOR: ${{ github.actor }}
4751
with:
4852
github-token: ${{ secrets.GH_TOKEN }}
4953
script: |
5054
github.rest.issues.createComment({
5155
issue_number: context.issue.number,
5256
owner: context.repo.owner,
5357
repo: context.repo.repo,
54-
body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ
58+
body: `Hello, @${process.env.ACTOR}! πŸ‘‹πŸΌ
5559
5660
I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!
5761

β€Ž.github/workflows/if-nodejs-pr-testing.ymlβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner.
18-
# See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001
19-
os: [ubuntu-latest, macos-13, windows-latest]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
2018
steps:
2119
- if: >
2220
!github.event.pull_request.draft && !(
@@ -52,7 +50,8 @@ jobs:
5250
shell: bash
5351
- if: steps.packagejson.outputs.exists == 'true'
5452
name: Check package-lock version
55-
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
53+
# This workflow is from our own org repo and safe to reference by 'master'.
54+
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master # //NOSONAR
5655
id: lockversion
5756
- if: steps.packagejson.outputs.exists == 'true'
5857
name: Setup Node.js

β€Ž.github/workflows/issues-prs-notifications.ymlβ€Ž

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Convert markdown to slack markdown for issue
24-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
24+
# This workflow is from our own org repo and safe to reference by 'master'.
25+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
2526
id: issuemarkdown
27+
env:
28+
ISSUE_TITLE: ${{github.event.issue.title}}
29+
ISSUE_URL: ${{github.event.issue.html_url}}
30+
ISSUE_BODY: ${{github.event.issue.body}}
2631
with:
27-
markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
32+
markdown: "[${{ env.ISSUE_TITLE }}](${{ env.ISSUE_URL }}) \n ${{ env.ISSUE_BODY }}"
2833
- name: Send info about issue
2934
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
3035
env:
@@ -39,10 +44,15 @@ jobs:
3944
runs-on: ubuntu-latest
4045
steps:
4146
- name: Convert markdown to slack markdown for pull request
42-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
47+
# This workflow is from our own org repo and safe to reference by 'master'.
48+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
4349
id: prmarkdown
50+
env:
51+
PR_TITLE: ${{github.event.pull_request.title}}
52+
PR_URL: ${{github.event.pull_request.html_url}}
53+
PR_BODY: ${{github.event.pull_request.body}}
4454
with:
45-
markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
55+
markdown: "[${{ env.PR_TITLE }}](${{ env.PR_URL }}) \n ${{ env.PR_BODY }}"
4656
- name: Send info about pull request
4757
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
4858
env:
@@ -57,10 +67,15 @@ jobs:
5767
runs-on: ubuntu-latest
5868
steps:
5969
- name: Convert markdown to slack markdown for pull request
60-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
70+
# This workflow is from our own org repo and safe to reference by 'master'.
71+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
6172
id: discussionmarkdown
73+
env:
74+
DISCUSSION_TITLE: ${{github.event.discussion.title}}
75+
DISCUSSION_URL: ${{github.event.discussion.html_url}}
76+
DISCUSSION_BODY: ${{github.event.discussion.body}}
6277
with:
63-
markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
78+
markdown: "[${{ env.DISCUSSION_TITLE }}](${{ env.DISCUSSION_URL }}) \n ${{ env.DISCUSSION_BODY }}"
6479
- name: Send info about pull request
6580
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
6681
env:

β€Ž.github/workflows/notify-tsc-members-mention.ymlβ€Ž

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343
# Handling Slack notifications
4444
#########
4545
- name: Convert markdown to slack markdown
46-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
46+
# This workflow is from our own org repo and safe to reference by 'master'.
47+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
4748
id: issuemarkdown
4849
with:
4950
markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
@@ -89,7 +90,8 @@ jobs:
8990
# Handling Slack notifications
9091
#########
9192
- name: Convert markdown to slack markdown
92-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
93+
# This workflow is from our own org repo and safe to reference by 'master'.
94+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
9395
id: prmarkdown
9496
with:
9597
markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
@@ -135,7 +137,8 @@ jobs:
135137
# Handling Slack notifications
136138
#########
137139
- name: Convert markdown to slack markdown
138-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
140+
# This workflow is from our own org repo and safe to reference by 'master'.
141+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
139142
id: discussionmarkdown
140143
with:
141144
markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
@@ -181,7 +184,8 @@ jobs:
181184
# Handling Slack notifications
182185
#########
183186
- name: Convert markdown to slack markdown
184-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
187+
# This workflow is from our own org repo and safe to reference by 'master'.
188+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
185189
id: issuemarkdown
186190
with:
187191
markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
@@ -227,7 +231,8 @@ jobs:
227231
# Handling Slack notifications
228232
#########
229233
- name: Convert markdown to slack markdown
230-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
234+
# This workflow is from our own org repo and safe to reference by 'master'.
235+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
231236
id: prmarkdown
232237
with:
233238
markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
@@ -273,7 +278,8 @@ jobs:
273278
# Handling Slack notifications
274279
#########
275280
- name: Convert markdown to slack markdown
276-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
281+
# This workflow is from our own org repo and safe to reference by 'master'.
282+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
277283
id: discussionmarkdown
278284
with:
279285
markdown: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"

β€Ž.github/workflows/release-announcements.ymlβ€Ž

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,24 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919
- name: Convert markdown to slack markdown for issue
20-
uses: asyncapi/.github/.github/actions/slackify-markdown@master
20+
# This workflow is from our own org repo and safe to reference by 'master'.
21+
uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR
2122
id: markdown
23+
env:
24+
RELEASE_TAG: ${{github.event.release.tag_name}}
25+
RELEASE_URL: ${{github.event.release.html_url}}
26+
RELEASE_BODY: ${{ github.event.release.body }}
2227
with:
23-
markdown: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}"
28+
markdown: "[${{ env.RELEASE_TAG }}](${{ env.RELEASE_URL }}) \n ${{ env.RELEASE_BODY }}"
2429
- name: Send info about release to Slack
2530
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
2631
env:
2732
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }}
28-
SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚
33+
SLACK_TITLE: Release ${{ env.RELEASE_TAG }} for ${{ env.REPO_NAME }} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚
2934
SLACK_MESSAGE: ${{steps.markdown.outputs.text}}
3035
MSG_MINIMAL: true
36+
RELEASE_TAG: ${{github.event.release.tag_name}}
37+
REPO_NAME: ${{github.repository}}
3138

3239
twitter-announce:
3340
name: Twitter - notify on minor and major releases
@@ -62,17 +69,27 @@ jobs:
6269
- name: Identify release type
6370
id: releasetype
6471
# if previousver is not provided then this steps just logs information about missing version, no errors
65-
run: echo "type=$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" >> $GITHUB_OUTPUT
72+
env:
73+
PREV_VERSION: ${{steps.versions.outputs.previousver}}
74+
LAST_VERSION: ${{steps.versions.outputs.lastver}}
75+
run: echo "type=$(npx -q -p semver-diff-cli semver-diff "$PREV_VERSION" "$LAST_VERSION")" >> $GITHUB_OUTPUT
6676
- name: Get name of the person that is behind the newly released version
6777
id: author
68-
run: echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
78+
run: |
79+
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
80+
printf 'name=%s\n' "$AUTHOR_NAME" >> $GITHUB_OUTPUT
6981
- name: Publish information about the release to Twitter # tweet only if detected version change is not a patch
7082
# tweet goes out even if the type is not major or minor but "You need provide version number to compare."
7183
# it is ok, it just means we did not identify previous version as we are tweeting out information about the release for the first time
7284
if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same
7385
uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0
86+
env:
87+
RELEASE_TAG: ${{github.event.release.tag_name}}
88+
REPO_NAME: ${{github.repository}}
89+
AUTHOR_NAME: ${{ steps.author.outputs.name }}
90+
RELEASE_URL: ${{github.event.release.html_url}}
7491
with:
75-
twitter_status: "Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚\n\nThank you for the contribution ${{ steps.author.outputs.name }} ${{github.event.release.html_url}}"
92+
twitter_status: "Release ${{ env.RELEASE_TAG }} for ${{ env.REPO_NAME }} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚\n\nThank you for the contribution ${{ env.AUTHOR_NAME }} ${{ env.RELEASE_URL }}"
7693
twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
7794
twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
7895
twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}

β€Ž.github/workflows/transfer-issue.ymlβ€Ž

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
env:
2424
COMMENT: "${{ github.event.comment.body }}"
2525
run: |
26-
REPO=$(echo $COMMENT | awk '{print $2}')
27-
echo repo=$REPO >> $GITHUB_OUTPUT
26+
REPO=$(echo "$COMMENT" | awk '{print $2}')
27+
echo "repo=$REPO" >> $GITHUB_OUTPUT
2828
- name: Check Repo
2929
uses: actions/github-script@v7
3030
with:
@@ -55,7 +55,8 @@ jobs:
5555
id: transferIssue
5656
working-directory: ./
5757
run: |
58-
gh issue transfer ${{github.event.issue.number}} asyncapi/${{steps.extract_step.outputs.repo}}
58+
gh issue transfer "$ISSUE_NUMBER" "asyncapi/$REPO_NAME"
5959
env:
6060
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
61+
ISSUE_NUMBER: ${{ github.event.issue.number }}
62+
REPO_NAME: ${{ steps.extract_step.outputs.repo }}

0 commit comments

Comments
Β (0)