-
Notifications
You must be signed in to change notification settings - Fork 12
Implement automatic PR updates #529
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
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1c89bf3
Implement automatic PR update
MattyTheHacker 11063a9
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 5fc2aa3
Create pr-auto-label.yml
MattyTheHacker 8224241
Rename pr-auto-label.yml to pr-auto-label.yaml
MattyTheHacker b278331
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 4a50ceb
Update pr-auto-label.yaml
MattyTheHacker d6024fa
Create pr-auto-merge.yml
MattyTheHacker 5d2d09e
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] f5e21f8
Merge branch 'main' into pr-auto-update
MattyTheHacker 054b415
Delete .github/workflows/pr-auto-label.yaml
MattyTheHacker 9d4608c
Delete .github/workflows/pr-auto-merge.yml
MattyTheHacker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: "Automatically mark PRs to sync" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
|
|
||
| jobs: | ||
| labeler: | ||
| if: github.event.pull_request.user.type != 'Bot' | ||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Add "sync" label to PR | ||
| run: gh pr edit "$PR_URL" --add-label sync --repo "$PR_REPO" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| PR_REPO: ${{ github.repository }} | ||
|
|
||
| - name: Comment on PR to explain sync label | ||
| run: gh pr comment "$PR_URL" --body "This pull request has been marked to **automatically | ||
| sync** to its base branch. You can **disable** this behavior by removing the `sync` | ||
| label." --repo "$PR_REPO" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| PR_REPO: ${{ github.repository }} |
MattyTheHacker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: "Automatically enable auto-merge on PRs" | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - ready_for_review | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| enable-automerge: | ||
| if: github.event.pull_request.draft == false | ||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Enable auto-merge for the PR | ||
| run: gh pr merge "$PR_URL" --auto --squash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.PR_AUTO_UPDATE_TOKEN }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: pr-auto-update | ||
| on: | ||
| push: {} | ||
MattyTheHacker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| jobs: | ||
| pr-auto-update: | ||
| name: Automatic PR Updater | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| contents: write | ||
| steps: | ||
| - uses: CSSUoB/[email protected] | ||
| env: | ||
| GITHUB_TOKEN: '${{ secrets.PR_AUTO_UPDATE_TOKEN }}' | ||
| PR_FILTER: 'labelled' | ||
| PR_LABELS: 'sync' | ||
| MERGE_CONFLICT_ACTION: 'label' | ||
| MERGE_CONFLICT_LABEL: 'conflict' | ||
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.
Uh oh!
There was an error while loading. Please reload this page.