chore: add PR lifecycle automation - #111
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds GitHub automation and settings to streamline PR lifecycle management on main, including enabling auto-merge for trusted contributors and Dependabot updates, plus setting a default Copilot merge strategy.
Changes:
- Add a workflow to enable squash auto-merge for PRs authored by an allowlisted set of users.
- Add a workflow to approve and enable squash auto-merge for eligible Dependabot patch/minor updates.
- Add Copilot repository merge settings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/pr-auto-merge.yml | Enables squash auto-merge for trusted, same-repo PRs targeting main. |
| .github/workflows/dependabot-auto-merge.yml | Auto-approves and enables squash auto-merge for Dependabot patch/minor PRs targeting main. |
| .github/copilot/settings.json | Configures Copilot’s default merge strategy for the repository. |
Suppressed comments (1)
.github/workflows/dependabot-auto-merge.yml:112
auto_merge_enabledis set toenabledAt(a timestamp) or empty, but this script compares it to the literal string"true". As a result, the "already enabled" short-circuit will never trigger, and the workflow may redundantly try to enable auto-merge every run.
if [[ "$auto_merge_enabled" == "true" ]]; then
echo "Auto-merge is already enabled." >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
Comment on lines
+95
to
+100
| if [[ "$auto_merge_enabled" == "true" ]]; then | ||
| gh api graphql \ | ||
| -f pullRequestId="$pr_id" \ | ||
| -f query='mutation($pullRequestId:ID!) { disablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId }) { pullRequest { id } } }' \ | ||
| >/dev/null | ||
| fi |
| @@ -0,0 +1 @@ | |||
| {"mergeStrategy":"merge"} | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repository settings found
main(Protect main), not legacy branch protection.Settings changed
.github/copilot/settings.jsonwith{"mergeStrategy":"merge"}for conflict sync.Protect mainruleset to require the exact checksbuildandMarkdown lint.mainprotected from force-pushes and deletion.main.Workflows added or modified
.github/workflows/pr-auto-merge.ymlpull_request_targetautomation for trusted repo-owned PRs tomain..github/workflows/dependabot-auto-merge.ymlExact required checks
buildMarkdown lintSecurity boundaries
pull_request_targetcheckout or execution of untrusted code.Validation
dotnet restore TeamBuilder.slnx: exit 0dotnet build TeamBuilder.slnx --configuration Release --no-restore: exit 0dotnet test TeamBuilder.slnx --configuration Release --no-build: exit 0npx markdownlint-cli2 "**/*.md": exit 0Limitations
main.Rollback
Protect mainruleset if needed.