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
23
.github/workflows/project-automation-pr.yaml
vendored
23
.github/workflows/project-automation-pr.yaml
vendored
|
@ -181,10 +181,12 @@ jobs:
|
|||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
run: |
|
||||
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[@]}"
|
||||
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!) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
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')"
|
||||
|
||||
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
|
||||
|
|
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