Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/release-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,12 @@
--body "${BODY}")"
fi
fi


# Enable auto-merge for clean cherry-picks; skip for draft conflict PRs

Check warning on line 318 in .github/workflows/release-bot.yaml

View check run for this annotation

probelabs / Visor: quality

logic Issue

The use of `|| true` suppresses any exit code from the `gh pr merge` command, causing the step to succeed even if enabling auto-merge fails. This can happen if the repository settings do not allow auto-merging or if there are permission issues. This silent failure can lead to confusion when pull requests are not merged as expected, as the workflow will not report any error.
Raw output
Remove `|| true` to ensure that the workflow step fails if the `gh pr merge` command encounters an error. This will make failures in the auto-merge process visible and allow for proper debugging and resolution.
if [ "${MERGE_FAILED}" -eq 0 ]; then
gh pr merge --auto --merge "${PR_URL}" --repo "${GITHUB_REPO}" || true

Check warning on line 320 in .github/workflows/release-bot.yaml

View check run for this annotation

probelabs / Visor: security

security Issue

The `gh pr merge` command is executed with `|| true`, which suppresses the exit code. If the command fails (e.g., due to insufficient permissions, an invalid PR URL, or other transient errors), the failure will be silently ignored. This could lead to a situation where a pull request that was expected to be auto-merged is not, without any notification or workflow failure, potentially delaying releases or critical patches.
Raw output
Remove `|| true` to ensure that the workflow step fails if the `gh pr merge` command fails. This will make the workflow fail and alert maintainers to the problem, allowing for manual intervention. If there are specific non-critical errors that should be ignored, add more specific error handling logic instead of silencing all failures.

Check warning on line 320 in .github/workflows/release-bot.yaml

View check run for this annotation

probelabs / Visor: architecture

architecture Issue

The use of `|| true` suppresses errors from the `gh pr merge` command. If enabling auto-merge fails (e.g., due to repository settings or permissions), the error is silently ignored. This can be misleading, as the workflow will report success while a key action has failed. While this pattern is used elsewhere in the file for less critical actions like adding comments, the failure to enable auto-merge is more significant and should be made visible to the user.
Raw output
Instead of swallowing the error, check the command's exit code and log a GitHub Actions warning if it fails. This provides immediate feedback in the workflow logs without failing the job.

Example replacement for line 320:
```bash
if ! gh pr merge --auto --merge "${PR_URL}" --repo "${GITHUB_REPO}"; then
  echo "::warning file=.github/workflows/release-bot.yaml,line=320::Failed to enable auto-merge on ${PR_URL}. Please ensure 'Allow auto-merge' is enabled in repository settings and that the token has correct permissions."
fi
```
fi

# Optionally label the PR if conflicts
if [ "${MERGE_FAILED}" -ne 0 ]; then
gh label create "needs-manual-cherry-pick" --color FF8700 --description "Cherry-pick has conflicts" --repo "${GITHUB_REPO}" 2>/dev/null || true
Expand Down
Loading