diff --git a/.github/workflows/project-automation-pr.yaml b/.github/workflows/project-automation-pr.yaml index 5fcfe52..4a3890f 100644 --- a/.github/workflows/project-automation-pr.yaml +++ b/.github/workflows/project-automation-pr.yaml @@ -167,27 +167,31 @@ jobs: }' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$STATUS_ID" -f status_id="$OPTION_ID" --silent - name: Find Linked Issues - id: links + id: linked_issues uses: hossainemruz/linked-issues@main with: pr_url: ${{github.event.pull_request.html_url}} format: IssueNumber - name: Output linked Issue list - run: echo "${{ steps.links.outputs.issues }}" + run: echo "${{ steps.linked_issues.outputs.issues }}" - name: Find the Issue ID env: GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}} run: | - item_id="$(gh api graphql -f query=' - query($owner: String!, $name: String!, $issue_number: Int!) { - repository(owner: $owner, name: $name) { - issue(number: $issue_number) { - id - } - } - }' -f owner="${{github.event.pull_request.head.repo.owner.login}}" -f name="${{github.event.pull_request.head.repo.name}}" -F issue_number=459 --jq='.data.repository.issue.id')" + declare -a issues=(${{ steps.linked_issues.outputs.issues }}) - echo 'ISSUE_ID='$item_id >> $GITHUB_ENV - echo "Issue ID: $item_id" + for i in "${issues[@]}" + do + item_id="$(gh api graphql -f query=' + query($owner: String!, $name: String!, $issue_number: Int!) { + repository(owner: $owner, name: $name) { + issue(number: $issue_number) { + id + } + } + }' -f owner="${{github.event.pull_request.head.repo.owner.login}}" -f name="${{github.event.pull_request.head.repo.name}}" -F issue_number=$i --jq='.data.repository.issue.id')" + + echo "Issue ID: $item_id" + done diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..cf2e377 --- /dev/null +++ b/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +data="455 459" +declare -a issues=($data) +for i in "${issues[@]}" +do + echo "Welcome $i times" +done \ No newline at end of file