From 342c429658112355396458bc789ca7db6f9898bc Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 22 Jul 2020 17:49:25 +0200 Subject: [PATCH] [skip changelog] Add workflow to mirror issue on Jira to ease grooming --- .github/workflows/jira-issue.yaml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/jira-issue.yaml diff --git a/.github/workflows/jira-issue.yaml b/.github/workflows/jira-issue.yaml new file mode 100644 index 00000000000..3a02b1aa8c8 --- /dev/null +++ b/.github/workflows/jira-issue.yaml @@ -0,0 +1,48 @@ +name: "Mirror new issue to Jira for grooming" + +on: + issues: + types: [opened] + +jobs: + create-issue: + runs-on: ubuntu-latest + + env: + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + + steps: + - name: Installs Jira CLI + uses: atlassian/gajira-cli@master + with: + version: 1.0.23 + + - name: Create issue + run: | + jira create \ + --noedit \ + -e ${{ secrets.JIRA_BASE_URL }} \ + -u ${{ secrets.JIRA_USER_EMAIL }} \ + -p ${{ secrets.JIRA_PROJECT_CODE }} \ + -i Task \ + -o summary="${{ github.event.issues.issue.title }}" \ + -o description="${{ github.event.issues.issue.body }}\n${{ github.event.issues.issue.html_url }}" \ + >> output + + - name: Set label on Jira issue + run: | + jira label add + $(cat output | awk '{split($0,a," "); print a[2]}') + grooming arduino-cli + + - name: Set label on Github issue + uses: actions/github-script@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['tracked'] + })