diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml index aed756a8..2db55d85 100644 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml @@ -27,6 +27,8 @@ jobs: steps: - name: Add ready-to-merge label uses: actions/github-script@v7 + env: + GITHUB_ACTOR: ${{ github.actor }} with: github-token: ${{ secrets.GH_TOKEN }} script: | @@ -56,7 +58,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ + body: `Hello, @${process.env.GITHUB_ACTOR}! πŸ‘‹πŸΌ This PR is not up to date with the base branch and can't be merged. Please update your branch manually with the latest version of the base branch. PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly. diff --git a/.github/workflows/bounty-program-commands.yml b/.github/workflows/bounty-program-commands.yml index b103a30a..c42e3005 100644 --- a/.github/workflows/bounty-program-commands.yml +++ b/.github/workflows/bounty-program-commands.yml @@ -33,13 +33,15 @@ jobs: steps: - name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command uses: actions/github-script@v7 + env: + ACTOR: ${{ github.actor }} with: github-token: ${{ secrets.GH_TOKEN }} script: | - const commentText = `❌ @${{github.actor}} is not authorized to use the Bounty Program's commands. + const commentText = `❌ @${process.env.ACTOR} is not authorized to use the Bounty Program's commands. These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`; - console.log(`❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command.`); + console.log(`❌ @${process.env.ACTOR} made an unauthorized attempt to use a Bounty Program's command.`); github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 07c64ff8..6228c56f 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Add comment to PR uses: actions/github-script@v7 + env: + ACTOR: ${{ github.actor }} with: github-token: ${{ secrets.GH_TOKEN }} script: | @@ -25,7 +27,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ + body: `Hello, @${process.env.ACTOR}! πŸ‘‹πŸΌ I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! @@ -44,6 +46,8 @@ jobs: steps: - name: Add comment to Issue uses: actions/github-script@v7 + env: + ACTOR: ${{ github.actor }} with: github-token: ${{ secrets.GH_TOKEN }} script: | @@ -51,7 +55,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ + body: `Hello, @${process.env.ACTOR}! πŸ‘‹πŸΌ I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! diff --git a/.github/workflows/issues-prs-notifications.yml b/.github/workflows/issues-prs-notifications.yml index 9d40627f..a05cd4b1 100644 --- a/.github/workflows/issues-prs-notifications.yml +++ b/.github/workflows/issues-prs-notifications.yml @@ -23,8 +23,12 @@ jobs: - name: Convert markdown to slack markdown for issue uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown + env: + ISSUE_TITLE: ${{github.event.issue.title}} + ISSUE_URL: ${{github.event.issue.html_url}} + ISSUE_BODY: ${{github.event.issue.body}} with: - markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" + markdown: "[${{ env.ISSUE_TITLE }}](${{ env.ISSUE_URL }}) \n ${{ env.ISSUE_BODY }}" - name: Send info about issue uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 env: @@ -41,8 +45,12 @@ jobs: - name: Convert markdown to slack markdown for pull request uses: asyncapi/.github/.github/actions/slackify-markdown@master id: prmarkdown + env: + PR_TITLE: ${{github.event.pull_request.title}} + PR_URL: ${{github.event.pull_request.html_url}} + PR_BODY: ${{github.event.pull_request.body}} with: - markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" + markdown: "[${{ env.PR_TITLE }}](${{ env.PR_URL }}) \n ${{ env.PR_BODY }}" - name: Send info about pull request uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 env: @@ -59,8 +67,12 @@ jobs: - name: Convert markdown to slack markdown for pull request uses: asyncapi/.github/.github/actions/slackify-markdown@master id: discussionmarkdown + env: + DISCUSSION_TITLE: ${{github.event.discussion.title}} + DISCUSSION_URL: ${{github.event.discussion.html_url}} + DISCUSSION_BODY: ${{github.event.discussion.body}} with: - markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" + markdown: "[${{ env.DISCUSSION_TITLE }}](${{ env.DISCUSSION_URL }}) \n ${{ env.DISCUSSION_BODY }}" - name: Send info about pull request uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 env: diff --git a/.github/workflows/release-announcements.yml b/.github/workflows/release-announcements.yml index 3cb35593..786b37f2 100644 --- a/.github/workflows/release-announcements.yml +++ b/.github/workflows/release-announcements.yml @@ -19,15 +19,21 @@ jobs: - name: Convert markdown to slack markdown for issue uses: asyncapi/.github/.github/actions/slackify-markdown@master id: markdown + env: + RELEASE_TAG: ${{github.event.release.tag_name}} + RELEASE_URL: ${{github.event.release.html_url}} + RELEASE_BODY: ${{ github.event.release.body }} with: - markdown: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}" + markdown: "[${{ env.RELEASE_TAG }}](${{ env.RELEASE_URL }}) \n ${{ env.RELEASE_BODY }}" - name: Send info about release to Slack uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 env: SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }} - SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚ + SLACK_TITLE: Release ${{ env.RELEASE_TAG }} for ${{ env.REPO_NAME }} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚ SLACK_MESSAGE: ${{steps.markdown.outputs.text}} MSG_MINIMAL: true + RELEASE_TAG: ${{github.event.release.tag_name}} + REPO_NAME: ${{github.repository}} twitter-announce: name: Twitter - notify on minor and major releases @@ -62,17 +68,27 @@ jobs: - name: Identify release type id: releasetype # if previousver is not provided then this steps just logs information about missing version, no errors - run: echo "type=$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" >> $GITHUB_OUTPUT + env: + PREV_VERSION: ${{steps.versions.outputs.previousver}} + LAST_VERSION: ${{steps.versions.outputs.lastver}} + run: echo "type=$(npx -q -p semver-diff-cli semver-diff "$PREV_VERSION" "$LAST_VERSION")" >> $GITHUB_OUTPUT - name: Get name of the person that is behind the newly released version id: author - run: echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT + run: | + AUTHOR_NAME=$(git log -1 --pretty=format:'%an') + printf 'name=%s\n' "$AUTHOR_NAME" >> $GITHUB_OUTPUT - name: Publish information about the release to Twitter # tweet only if detected version change is not a patch # tweet goes out even if the type is not major or minor but "You need provide version number to compare." # 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 if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0 + env: + RELEASE_TAG: ${{github.event.release.tag_name}} + REPO_NAME: ${{github.repository}} + AUTHOR_NAME: ${{ steps.author.outputs.name }} + RELEASE_URL: ${{github.event.release.html_url}} with: - 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}}" + 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 }}" twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} diff --git a/.github/workflows/transfer-issue.yml b/.github/workflows/transfer-issue.yml index 045a621b..dbe84ca6 100644 --- a/.github/workflows/transfer-issue.yml +++ b/.github/workflows/transfer-issue.yml @@ -23,8 +23,8 @@ jobs: env: COMMENT: "${{ github.event.comment.body }}" run: | - REPO=$(echo $COMMENT | awk '{print $2}') - echo repo=$REPO >> $GITHUB_OUTPUT + REPO=$(echo "$COMMENT" | awk '{print $2}') + echo "repo=$REPO" >> $GITHUB_OUTPUT - name: Check Repo uses: actions/github-script@v7 with: @@ -55,7 +55,8 @@ jobs: id: transferIssue working-directory: ./ run: | - gh issue transfer ${{github.event.issue.number}} asyncapi/${{steps.extract_step.outputs.repo}} + gh issue transfer "$ISSUE_NUMBER" "asyncapi/$REPO_NAME" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + ISSUE_NUMBER: ${{ github.event.issue.number }} + REPO_NAME: ${{ steps.extract_step.outputs.repo }}