Update workflow

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
hossainemruz 2021-11-05 02:46:54 +06:00
parent 8ff2ec19ae
commit 2c9a269b5f
2 changed files with 23 additions and 12 deletions

View file

@ -167,19 +167,23 @@ 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: |
declare -a issues=(${{ steps.linked_issues.outputs.issues }})
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) {
@ -187,7 +191,7 @@ jobs:
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')"
}' -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 >> $GITHUB_ENV
echo "Issue ID: $item_id"
done

7
test.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
data="455 459"
declare -a issues=($data)
for i in "${issues[@]}"
do
echo "Welcome $i times"
done