|
8 | 8 | close-issue:
|
9 | 9 | runs-on: ubuntu-latest
|
10 | 10 | steps:
|
11 |
| - - name: Checkout |
12 |
| - uses: actions/checkout@v4 |
13 |
| - with: |
14 |
| - persist-credentials: false |
15 |
| - repository: snowflakedb/gh-actions |
16 |
| - ref: jira_v1 |
17 |
| - token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets |
18 |
| - path: . |
19 |
| - - name: Jira login |
20 |
| - uses: atlassian/gajira-login@v3 |
21 |
| - env: |
22 |
| - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} |
23 |
| - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} |
24 |
| - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} |
25 | 11 | - name: Extract issue from title
|
26 | 12 | id: extract
|
27 | 13 | env:
|
28 | 14 | TITLE: "${{ github.event.issue.title }}"
|
29 | 15 | run: |
|
30 | 16 | jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
|
31 | 17 | echo ::set-output name=jira::$jira
|
32 |
| - - name: Close issue |
33 |
| - uses: ./jira/gajira-close |
| 18 | +
|
| 19 | + - name: Close Jira Issue |
34 | 20 | if: startsWith(steps.extract.outputs.jira, 'SNOW-')
|
35 |
| - with: |
36 |
| - issue: "${{ steps.extract.outputs.jira }}" |
| 21 | + run: | |
| 22 | + ISSUE_KEY="${{ steps.extract.outputs.jira }}" |
| 23 | + JIRA_API_URL="${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/${ISSUE_KEY}/transitions" |
| 24 | +
|
| 25 | + curl -X POST \ |
| 26 | + --url "$JIRA_API_URL" \ |
| 27 | + --user "${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \ |
| 28 | + --header "Content-Type: application/json" \ |
| 29 | + --data "{ |
| 30 | + \"update\": { |
| 31 | + \"comment\": [ |
| 32 | + { \"add\": { \"body\": \"Closed on GitHub\" } } |
| 33 | + ] |
| 34 | + }, |
| 35 | + \"fields\": { |
| 36 | + \"customfield_12860\": { \"id\": \"11506\" }, |
| 37 | + \"customfield_10800\": { \"id\": \"-1\" }, |
| 38 | + \"customfield_12500\": { \"id\": \"11302\" }, |
| 39 | + \"customfield_12400\": { \"id\": \"-1\" }, |
| 40 | + \"resolution\": { \"name\": \"Done\" } |
| 41 | + }, |
| 42 | + \"transition\": { \"id\": \"71\" } |
| 43 | + }" |
0 commit comments