From 64a4cc86bf9b08cb67ee8a4792b2c9dfb138c904 Mon Sep 17 00:00:00 2001 From: eavanvalkenburg Date: Thu, 16 Jan 2025 14:18:05 +0100 Subject: [PATCH] add workflow to create issue from needs port --- .github/workflows/label-needs-port.yml | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/label-needs-port.yml diff --git a/.github/workflows/label-needs-port.yml b/.github/workflows/label-needs-port.yml new file mode 100644 index 000000000000..a60085209035 --- /dev/null +++ b/.github/workflows/label-needs-port.yml @@ -0,0 +1,41 @@ +name: Create Issue when Needs Port label is added +on: + issues: + types: [labeled] + pull_request_target: + types: [labeled] + +jobs: + create_issue: + if: startsWith(github.event.issue.labels.*.name, 'needs_port_to_') || startsWith(github.event.pull_request.labels.*.name, 'needs_port_to_') + name: "Create Issue" + continue-on-error: true + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: read + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + + steps: + - name: Create dotnet issue + if: startsWith(github.event.issue.labels.*.name, 'needs_port_to_dotnet') || startsWith(github.event.pull_request.labels.*.name, 'needs_port_to_dotnet') + run: | + new_issue_url=$(gh issue create \ + --title "Port python feature: ${{ github.event.issue.title || github.event.pull_request.title }}" \ + --label ".NET" \ + --body "# Original issue + ${{ github.event.issue.html_url || github.event.pull_request.html_url }} + ## Description + ${{ github.event.issue.body || github.event.pull_request.body }}") + - name: Create python issue + if: startsWith(github.event.issue.labels.*.name, 'needs_port_to_python') || startsWith(github.event.pull_request.labels.*.name, 'needs_port_to_python') + run: | + new_issue_url=$(gh issue create \ + --title "Port dotnet feature: ${{ github.event.issue.title || github.event.pull_request.title }}" \ + --label "Python" \ + --body "# Original issue + ${{ github.event.issue.html_url || github.event.pull_request.html_url }} + ## Description + ${{ github.event.issue.body || github.event.pull_request.body }}")