|
| 1 | +# Workflow to ensure whenever a Github PR is submitted, |
| 2 | +# a JIRA ticket gets created automatically. |
| 3 | +name: Manual Workflow |
| 4 | + |
| 5 | +# Controls when the action will run. |
| 6 | +on: |
| 7 | + # Triggers the workflow on pull request events but only for the master branch |
| 8 | + pull_request_target: |
| 9 | + types: [opened, reopened] |
| 10 | + |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + test-transition-issue: |
| 16 | + name: Convert Github Issue to Jira Issue |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@master |
| 21 | + |
| 22 | + - name: Login |
| 23 | + uses: atlassian/gajira-login@master |
| 24 | + env: |
| 25 | + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} |
| 26 | + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} |
| 27 | + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} |
| 28 | + |
| 29 | + - name: Create NEW JIRA ticket |
| 30 | + id: create |
| 31 | + uses: atlassian/gajira-create@master |
| 32 | + with: |
| 33 | + project: CONUPDATE |
| 34 | + issuetype: Task |
| 35 | + summary: | |
| 36 | + Github PR [Assign the ND component] | Repo: ${{ github.repository }} | PR# ${{github.event.number}} |
| 37 | + description: | |
| 38 | + Repo link: https://github.com/${{ github.repository }} |
| 39 | + PR no. ${{ github.event.pull_request.number }} |
| 40 | + PR title: ${{ github.event.pull_request.title }} |
| 41 | + PR description: ${{ github.event.pull_request.description }} |
| 42 | + In addition, please resolve other issues, if any. |
| 43 | + fields: '{"components": [{"name":"nd013 - Self Driving Car Engineer ND"}], "customfield_16449":"https://classroom.udacity.com/", "customfield_16450":"Resolve the PR", "labels": ["github"], "priority":{"id": "4"}}' |
| 44 | + |
| 45 | + - name: Log created issue |
| 46 | + run: echo "Issue ${{ steps.create.outputs.issue }} was created" |
0 commit comments