Skip to content

Enable rebuilding PRs with conflicts #3014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

henrymercer
Copy link
Contributor

Since we check in our compiled code, we frequently get merge conflicts in the compiled code. We have a rebuild Action, but label triggers don't run when there are merge conflicts. So this PR adds a workflow_dispatch trigger that lets us rebuild a PR with conflicts via workflow_dispatch.

Example run: https://github.com/github/codeql-action/actions/runs/16809277853

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner August 7, 2025 16:20
@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 16:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables rebuilding PRs with merge conflicts by adding a workflow_dispatch trigger to the rebuild workflow. Since label triggers don't work when PRs have conflicts, this provides an alternative way to rebuild the compiled code through manual workflow dispatch.

  • Added workflow_dispatch trigger alongside existing label trigger
  • Updated condition logic to handle both trigger types with fallback values
  • Moved PR-specific operations (label removal, commenting) to be conditional on pull request events
Comments suppressed due to low confidence (2)

.github/workflows/rebuild.yml:80

  • The set-output command is deprecated and will be removed. Use echo "changes=true" >> $GITHUB_OUTPUT instead.
            echo "::set-output name=changes::true"

.github/workflows/rebuild.yml:92

  • [nitpick] The notification logic has been moved outside the conditional block but still executes the same commands. This creates duplicate logic that was previously inside the 'if' statement. Consider keeping this logic together with the push operation or clearly separating the concerns.
          echo "Pushed a commit to rebuild the Action." \
            "Please mark the PR as ready for review to trigger PR checks." |
            gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER"
          gh pr ready --undo --repo github/codeql-action "$PR_NUMBER"

mbg
mbg previously approved these changes Aug 7, 2025
mbg
mbg previously approved these changes Aug 7, 2025
@henrymercer henrymercer force-pushed the henrymercer/rebuild-dispatch branch 3 times, most recently from 4175311 to eaa1870 Compare August 7, 2025 17:18
@henrymercer henrymercer force-pushed the henrymercer/rebuild-dispatch branch from eaa1870 to bd62bf4 Compare August 7, 2025 17:22
@henrymercer henrymercer requested a review from mbg August 7, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants