Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: update of files from global .github repo #1165

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/help-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ jobs:
At the moment the following comments are supported in issues:

- \`/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\`.
example: \`/gfi js\` or \`/good-first-issue ci-cd\``
example: \`/gfi js\` or \`/good-first-issue ci-cd\`
- \`/transfer-issue {repo-name}\` or \`/ti {repo-name}\` - transfer issue from the source repository to the other repository passed by the user. example: \`/ti cli\` or \`/transfer-issue cli\`.`
})
57 changes: 57 additions & 0 deletions .github/workflows/transfer-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This action is centrally managed in https://github.com/asyncapi/.github/
# 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

name: Transfer Issues between repositories

on:
issue_comment:
types:
- created

jobs:
transfer:
if: ${{(!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot') && (startsWith(github.event.comment.body, '/transfer-issue') || startsWith(github.event.comment.body, '/ti'))}}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Extract Input
id: extract_step
run: |
COMMENT="${{github.event.comment.body}}"
REPO=$(echo $COMMENT | awk '{print $2}')
echo repo=$REPO >> $GITHUB_OUTPUT
- name: Check Repo
uses: actions/github-script@v7
with:
github-token: ${{secrets.GH_TOKEN}}
script: |
const r = "${{github.repository}}"
const [owner, repo] = r.split('/')
const repoToMove = process.env.REPO_TO_MOVE
const issue_number = context.issue.number
try {
const {data} = await github.rest.repos.get({
owner,
repo: repoToMove
})
}catch (e) {
const body = `${repoToMove} is not a repo under ${owner}. You can only transfer issue to repos that belong to the same organization.`
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body
})
process.exit(1)
}
env:
REPO_TO_MOVE: ${{steps.extract_step.outputs.repo}}
- name: Transfer Issue
id: transferIssue
working-directory: ./
run: |
gh issue transfer ${{github.event.issue.number}} asyncapi/${{steps.extract_step.outputs.repo}}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}