Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/jira-pr_add_jira_summary.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pr_jira_actions.yml
Original file line number Diff line number Diff line change
@@ -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

Check failure on line 10 in .github/workflows/pr_jira_actions.yml

View workflow job for this annotation

GitHub Actions / Zizmor analysis (annotate) / Security Scan

excessive-permissions

pr_jira_actions.yml:10: overly broad permissions: uses write-all permissions
secrets:
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
10 changes: 6 additions & 4 deletions .github/workflows/reusable-jira-pr_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Loading