Update workflow
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
parent
2c9a269b5f
commit
db741952c6
2 changed files with 20 additions and 10 deletions
21
.github/workflows/project-automation-pr.yaml
vendored
21
.github/workflows/project-automation-pr.yaml
vendored
|
@ -182,9 +182,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
declare -a issues=(${{ steps.linked_issues.outputs.issues }})
|
declare -a issues=(${{ steps.linked_issues.outputs.issues }})
|
||||||
|
|
||||||
|
# Loop through the every issues and update their Status to same as the PR Status
|
||||||
for i in "${issues[@]}"
|
for i in "${issues[@]}"
|
||||||
do
|
do
|
||||||
item_id="$(gh api graphql -f query='
|
# Find the Issue ID
|
||||||
|
ISSUE_ID="$(gh api graphql -f query='
|
||||||
query($owner: String!, $name: String!, $issue_number: Int!) {
|
query($owner: String!, $name: String!, $issue_number: Int!) {
|
||||||
repository(owner: $owner, name: $name) {
|
repository(owner: $owner, name: $name) {
|
||||||
issue(number: $issue_number) {
|
issue(number: $issue_number) {
|
||||||
|
@ -193,5 +195,20 @@ jobs:
|
||||||
}
|
}
|
||||||
}' -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')"
|
}' -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"
|
echo "Issue ID: $issue_id"
|
||||||
|
|
||||||
|
# Update the Issue Status
|
||||||
|
gh api graphql -f query='
|
||||||
|
mutation ($project: ID!, $item: ID!, $field: ID!, $status_id: ID!) {
|
||||||
|
updateProjectNextItemField(input: {
|
||||||
|
projectId: $project
|
||||||
|
itemId: $item
|
||||||
|
fieldId: $field
|
||||||
|
value: $status_id
|
||||||
|
}) {
|
||||||
|
projectNextItem {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}' -f project="$PROJECT_ID" -f item="$ISSUE_ID" -f field="$STATUS_ID" -f status_id="$PR_STATUS" --silent
|
||||||
done
|
done
|
||||||
|
|
7
test.sh
7
test.sh
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
data="455 459"
|
|
||||||
declare -a issues=($data)
|
|
||||||
for i in "${issues[@]}"
|
|
||||||
do
|
|
||||||
echo "Welcome $i times"
|
|
||||||
done
|
|
Loading…
Add table
Add a link
Reference in a new issue