diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 3f4dcbc4..4dc443d2 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -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\` + - \`/trasfer-issue {repo-name}\` or \`/ti {repo-name}\` - trasfers issue from the source repository to the other repository passed by the user. example: \`/ti cli\` or \`/trasfer-issue cli\` }) \ No newline at end of file diff --git a/.github/workflows/transfer-issue.yml b/.github/workflows/transfer-issue.yml new file mode 100644 index 00000000..2e1126ce --- /dev/null +++ b/.github/workflows/transfer-issue.yml @@ -0,0 +1,35 @@ + +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') && (contains(github.event.comment.body, '/trasfer-issue') || contains(github.event.comment.body, '/ti'))}} + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Install GitHub CLI + run: | + sudo apt-get update + sudo apt-get install gh + - name: Authenticate GitHub CLI + run: | + gh action login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" + + - name: Extract Input + id: extract_step + run: | + COMMENT="${{github.event.comment.body}}" + REPO=$(echo $COMMENT | awk '{print $2}') + echo repo=$REPO >> $GITHUB_OUTPUT + + - name: Trasfer Issue + run: | + gh issue transfer ${{github.event.issue.number}} asyncapi/${{steps.extract_step.outputs.repo}} +