Skip to content

Commit 005d855

Browse files
Merge master into dependabot/npm_and_yarn/jsonpath-plus-10.2.0
2 parents 3eaf0a8 + 01e2ccb commit 005d855

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.github/workflows/help-command.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ jobs:
5858
At the moment the following comments are supported in issues:
5959

6060
- \`/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\`.
61-
example: \`/gfi js\` or \`/good-first-issue ci-cd\``
61+
example: \`/gfi js\` or \`/good-first-issue ci-cd\`
62+
- \`/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\`.`
6263
})

.github/workflows/transfer-issue.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This action is centrally managed in https://github.com/asyncapi/.github/
2+
# 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
3+
4+
name: Transfer Issues between repositories
5+
6+
on:
7+
issue_comment:
8+
types:
9+
- created
10+
11+
jobs:
12+
transfer:
13+
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'))}}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
- name: Extract Input
19+
id: extract_step
20+
run: |
21+
COMMENT="${{github.event.comment.body}}"
22+
REPO=$(echo $COMMENT | awk '{print $2}')
23+
echo repo=$REPO >> $GITHUB_OUTPUT
24+
- name: Check Repo
25+
uses: actions/github-script@v7
26+
with:
27+
github-token: ${{secrets.GH_TOKEN}}
28+
script: |
29+
const r = "${{github.repository}}"
30+
const [owner, repo] = r.split('/')
31+
const repoToMove = process.env.REPO_TO_MOVE
32+
const issue_number = context.issue.number
33+
try {
34+
const {data} = await github.rest.repos.get({
35+
owner,
36+
repo: repoToMove
37+
})
38+
}catch (e) {
39+
const body = `${repoToMove} is not a repo under ${owner}. You can only transfer issue to repos that belong to the same organization.`
40+
await github.rest.issues.createComment({
41+
owner,
42+
repo,
43+
issue_number,
44+
body
45+
})
46+
process.exit(1)
47+
}
48+
env:
49+
REPO_TO_MOVE: ${{steps.extract_step.outputs.repo}}
50+
- name: Transfer Issue
51+
id: transferIssue
52+
working-directory: ./
53+
run: |
54+
gh issue transfer ${{github.event.issue.number}} asyncapi/${{steps.extract_step.outputs.repo}}
55+
env:
56+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
57+

0 commit comments

Comments
 (0)