Skip to content

Commit 09287f6

Browse files
authored
Fix workflow name in automated PRs manager (#1491)
1 parent cd7f2dc commit 09287f6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/automated-prs-manager.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
gh pr edit "${{ matrix.pr.url }}" --add-label "type::security"
5959
6060
echo "Checking status of tests..."
61-
run_id=$(gh run list --branch "${{ matrix.pr.headRefName }}" --workflow build-test --limit 1 --json databaseId -q '.[0].databaseId')
61+
run_id=$(gh run list --branch "${{ matrix.pr.headRefName }}" --workflow build-test-deploy --limit 1 --json databaseId -q '.[0].databaseId')
6262
6363
# If there are still pending jobs, skip.
6464
@@ -70,7 +70,7 @@ jobs:
7070
7171
# If all checks passed, approve and merge.
7272
if gh run view "$run_id" --json jobs -q '.jobs[] | select(.name == "validate-success") | .conclusion' | grep -q "success"; then
73-
if gh pr checks "${{ matrix.pr.url }}" ; then
73+
if gh pr checks "${{ matrix.pr.url }}"; then
7474
echo "All tests passed. Approving and merging."
7575
echo -e "LGTM :thumbsup: \n\nThis PR was automatically approved and merged by the [automated-prs-manager](https://github.com/replicatedhq/troubleshoot/blob/main/.github/workflows/automated-prs-manager.yaml) GitHub action" > body.txt
7676
gh pr review --approve "${{ matrix.pr.url }}" --body-file body.txt
@@ -86,7 +86,7 @@ jobs:
8686
# If more than half of the jobs are successful, re-run the failed jobs.
8787
8888
num_of_jobs=$(gh run view "$run_id" --json jobs -q '.jobs[].name ' | wc -l)
89-
num_of_successful_jobs=$(gh run view "$run_id" --json jobs -q '.jobs[] | select (.conclusion == "success")) |.name ' | wc -l)
89+
num_of_successful_jobs=$(gh run view "$run_id" --json jobs -q '.jobs[] | select(.conclusion == "success") | .name' | wc -l)
9090
9191
if [ "$num_of_successful_jobs" -gt $((num_of_jobs / 2)) ]; then
9292
echo "More than half of the jobs are successful. Re-running failed jobs."

.github/workflows/build-test-deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: build-test-deploy
2+
13
on:
24
pull_request:
35
types:

0 commit comments

Comments
 (0)