diff --git a/.github/workflows/jira-pr_add_jira_summary.yml b/.github/workflows/jira-pr_add_jira_summary.yml deleted file mode 100644 index e6d3c65..0000000 --- a/.github/workflows/jira-pr_add_jira_summary.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Add JIRA issue summary - -permissions: - contents: read - pull-requests: write - -on: - pull_request: - types: [opened] - -jobs: - call-workflow-add-jira-issue-summary: - uses: ./.github/workflows/reusable-jira-pr_add_jira_summary.yml - secrets: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} diff --git a/.github/workflows/pr_jira_actions.yml b/.github/workflows/pr_jira_actions.yml new file mode 100644 index 0000000..e31e439 --- /dev/null +++ b/.github/workflows/pr_jira_actions.yml @@ -0,0 +1,14 @@ +name: JIRA actions + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + call-workflow-pr_jira_actions: + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_actions.yml@DEVOPS-1032-pr-action-query-issue + permissions: write-all + secrets: + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} diff --git a/.github/workflows/reusable-jira-pr_actions.yml b/.github/workflows/reusable-jira-pr_actions.yml index ae5333c..b58503c 100644 --- a/.github/workflows/reusable-jira-pr_actions.yml +++ b/.github/workflows/reusable-jira-pr_actions.yml @@ -22,9 +22,7 @@ env: JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} -permissions: - contents: read - pull-requests: write +permissions: write-all jobs: get_issue_key: @@ -146,12 +144,16 @@ jobs: jql="Sprint in (openSprints(), futureSprints()) and issue=$issue_key" jqlencoded=$(jq -R -r @uri <<<"$jql") - response=$(curl -fsS --request GET \ + response=$(curl -vvv -fsS --request GET \ --url "$JIRA_BASE_URL/rest/api/3/search/jql?jql=$jqlencoded&fields=statusCategory" \ --user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json') + echo "$JIRA_BASE_URL/rest/api/3/search/jql?jql=$jqlencoded&fields=statusCategory" + echo "response=$response" + echo "email: $JIRA_USER_EMAIL" + if [ $? -ne 0 ]; then echo "Jira API: error" exit 1