Skip to content

Commit 7cbc3e6

Browse files
authored
ci: update of files from global .github repo (#447)
1 parent f929ead commit 7cbc3e6

7 files changed

+64
-22
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/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-version-bump.ymlβ€Ž

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,23 @@ jobs:
4646
# There is no need to substract "v" from the tag as version script handles it
4747
# When adding "bump:version" script in package.json, make sure no tags are added by default (--no-git-tag-version) as they are already added by release workflow
4848
# When adding "bump:version" script in package.json, make sure --allow-same-version is set in case someone forgot and updated package.json manually and we want to avoide this action to fail and raise confusion
49-
run: VERSION=${{github.event.release.tag_name}} npm run bump:version
49+
env:
50+
VERSION: ${{github.event.release.tag_name}}
51+
run: npm run bump:version
5052
- if: steps.packagejson.outputs.exists == 'true'
5153
name: Create Pull Request with updated asset files including package.json
5254
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # use 4.2.4 https://github.com/peter-evans/create-pull-request/releases/tag/v4.2.4
55+
env:
56+
RELEASE_TAG: ${{github.event.release.tag_name}}
57+
RELEASE_URL: ${{github.event.release.html_url}}
5358
with:
5459
token: ${{ secrets.GH_TOKEN }}
55-
commit-message: 'chore(release): ${{github.event.release.tag_name}}'
60+
commit-message: 'chore(release): ${{ env.RELEASE_TAG }}'
5661
committer: asyncapi-bot <[email protected]>
5762
author: asyncapi-bot <[email protected]>
58-
title: 'chore(release): ${{github.event.release.tag_name}}'
59-
body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})'
60-
branch: version-bump/${{github.event.release.tag_name}}
63+
title: 'chore(release): ${{ env.RELEASE_TAG }}'
64+
body: 'Version bump in package.json for release [${{ env.RELEASE_TAG }}](${{ env.RELEASE_URL }})'
65+
branch: version-bump/${{ env.RELEASE_TAG }}
6166
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
6267
name: Report workflow run status to Slack
6368
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 #using https://github.com/8398a7/action-slack/releases/tag/v3.16.2

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ jobs:
2323
- name: Convert markdown to slack markdown for issue
2424
uses: asyncapi/.github/.github/actions/slackify-markdown@master
2525
id: issuemarkdown
26+
env:
27+
ISSUE_TITLE: ${{github.event.issue.title}}
28+
ISSUE_URL: ${{github.event.issue.html_url}}
29+
ISSUE_BODY: ${{github.event.issue.body}}
2630
with:
27-
markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
31+
markdown: "[${{ env.ISSUE_TITLE }}](${{ env.ISSUE_URL }}) \n ${{ env.ISSUE_BODY }}"
2832
- name: Send info about issue
2933
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
3034
env:
@@ -41,8 +45,12 @@ jobs:
4145
- name: Convert markdown to slack markdown for pull request
4246
uses: asyncapi/.github/.github/actions/slackify-markdown@master
4347
id: prmarkdown
48+
env:
49+
PR_TITLE: ${{github.event.pull_request.title}}
50+
PR_URL: ${{github.event.pull_request.html_url}}
51+
PR_BODY: ${{github.event.pull_request.body}}
4452
with:
45-
markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
53+
markdown: "[${{ env.PR_TITLE }}](${{ env.PR_URL }}) \n ${{ env.PR_BODY }}"
4654
- name: Send info about pull request
4755
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
4856
env:
@@ -59,8 +67,12 @@ jobs:
5967
- name: Convert markdown to slack markdown for pull request
6068
uses: asyncapi/.github/.github/actions/slackify-markdown@master
6169
id: discussionmarkdown
70+
env:
71+
DISCUSSION_TITLE: ${{github.event.discussion.title}}
72+
DISCUSSION_URL: ${{github.event.discussion.html_url}}
73+
DISCUSSION_BODY: ${{github.event.discussion.body}}
6274
with:
63-
markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
75+
markdown: "[${{ env.DISCUSSION_TITLE }}](${{ env.DISCUSSION_URL }}) \n ${{ env.DISCUSSION_BODY }}"
6476
- name: Send info about pull request
6577
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
6678
env:

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@ jobs:
1919
- name: Convert markdown to slack markdown for issue
2020
uses: asyncapi/.github/.github/actions/slackify-markdown@master
2121
id: markdown
22+
env:
23+
RELEASE_TAG: ${{github.event.release.tag_name}}
24+
RELEASE_URL: ${{github.event.release.html_url}}
25+
RELEASE_BODY: ${{ github.event.release.body }}
2226
with:
23-
markdown: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}"
27+
markdown: "[${{ env.RELEASE_TAG }}](${{ env.RELEASE_URL }}) \n ${{ env.RELEASE_BODY }}"
2428
- name: Send info about release to Slack
2529
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2
2630
env:
2731
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }}
28-
SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚
32+
SLACK_TITLE: Release ${{ env.RELEASE_TAG }} for ${{ env.REPO_NAME }} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚
2933
SLACK_MESSAGE: ${{steps.markdown.outputs.text}}
3034
MSG_MINIMAL: true
35+
RELEASE_TAG: ${{github.event.release.tag_name}}
36+
REPO_NAME: ${{github.repository}}
3137

3238
twitter-announce:
3339
name: Twitter - notify on minor and major releases
@@ -62,17 +68,27 @@ jobs:
6268
- name: Identify release type
6369
id: releasetype
6470
# 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
71+
env:
72+
PREV_VERSION: ${{steps.versions.outputs.previousver}}
73+
LAST_VERSION: ${{steps.versions.outputs.lastver}}
74+
run: echo "type=$(npx -q -p semver-diff-cli semver-diff "$PREV_VERSION" "$LAST_VERSION")" >> $GITHUB_OUTPUT
6675
- name: Get name of the person that is behind the newly released version
6776
id: author
68-
run: echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
77+
run: |
78+
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
79+
printf 'name=%s\n' "$AUTHOR_NAME" >> $GITHUB_OUTPUT
6980
- name: Publish information about the release to Twitter # tweet only if detected version change is not a patch
7081
# tweet goes out even if the type is not major or minor but "You need provide version number to compare."
7182
# 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
7283
if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same
7384
uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0
85+
env:
86+
RELEASE_TAG: ${{github.event.release.tag_name}}
87+
REPO_NAME: ${{github.repository}}
88+
AUTHOR_NAME: ${{ steps.author.outputs.name }}
89+
RELEASE_URL: ${{github.event.release.html_url}}
7490
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}}"
91+
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 }}"
7692
twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
7793
twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
7894
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)