Skip to content

feat: add merge queue support to GitHub Actions workflow #535

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

Merged
merged 2 commits into from
May 28, 2025

Conversation

knqyf263
Copy link
Collaborator

Summary

  • Add merge_group trigger to GitHub Actions workflow to support GitHub merge queue functionality
  • This enables CI tests to run when PRs are added to the merge queue

Changes

  • Updated .github/workflows/go.yml to include merge_group event trigger alongside existing push and pull_request triggers

Test plan

  • Verify workflow triggers correctly on merge queue events
  • Test merge queue functionality once enabled in repository settings

Background

This change is required for GitHub merge queue to function properly. Without the merge_group trigger, status checks will not be triggered when PRs are added to a merge queue, causing merges to fail due to missing required status checks.

References:

@knqyf263 knqyf263 enabled auto-merge May 28, 2025 12:29
@knqyf263 knqyf263 disabled auto-merge May 28, 2025 12:29
@knqyf263
Copy link
Collaborator Author

knqyf263 commented May 28, 2025

@DmitriyLewen The documentation about bypassing the merge queue has been removed from GitHub. It might be working now even without adding a bypass. Could you approve this PR?

@knqyf263 knqyf263 enabled auto-merge May 28, 2025 12:32
@knqyf263 knqyf263 added this pull request to the merge queue May 28, 2025
@DmitriyLewen
Copy link
Contributor

Looks like it works 👍

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 28, 2025
@knqyf263
Copy link
Collaborator Author

Hmm. The merge queue removed this PR. I'll add a bypass workflow.

Comment on lines +8 to +11
name: license/cla
runs-on: ubuntu-latest
steps:
- run: 'echo "No test required"'

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 9 days ago

To fix the issue, we need to add a permissions block to the workflow. Since the workflow does not require write access or any special permissions, we will set the permissions to contents: read. This ensures the workflow adheres to the principle of least privilege and avoids inheriting potentially excessive permissions from the repository.

The permissions block should be added at the root level of the workflow, as it applies to all jobs unless overridden by job-specific permissions.


Suggested changeset 1
.github/workflows/cla.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
--- a/.github/workflows/cla.yml
+++ b/.github/workflows/cla.yml
@@ -2,2 +2,4 @@
 name: CLA
+permissions:
+  contents: read
 on:
EOF
@@ -2,2 +2,4 @@
name: CLA
permissions:
contents: read
on:
Copilot is powered by AI and may make mistakes. Always verify output.
@knqyf263 knqyf263 added this pull request to the merge queue May 28, 2025
Merged via the queue into main with commit 4d68b9e May 28, 2025
6 checks passed
@knqyf263 knqyf263 deleted the feature/add-merge-queue-support branch May 28, 2025 13:54
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