Skip to content

Commit 647fe1f

Browse files
committedFeb 1, 2023
- adds conflicting and auto merge workflows

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Auto-merge dependabot updates
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
11+
jobs:
12+
13+
dependabot-merge:
14+
15+
runs-on: ubuntu-latest
16+
17+
if: ${{ github.actor == 'dependabot[bot]' }}
18+
19+
steps:
20+
- name: Dependabot metadata
21+
id: metadata
22+
uses: dependabot/fetch-metadata@v1.3.6
23+
with:
24+
github-token: "${{ secrets.GITHUB_TOKEN }}"
25+
26+
- name: Enable auto-merge for Dependabot PRs
27+
# Only if version bump is not a major version change
28+
if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
29+
run: gh pr merge --auto --merge "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: PullRequestConflicting
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
types: [synchronize]
12+
branches: [ main ]
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
build:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
- name: check if prs are dirty
24+
uses: eps1lon/actions-label-merge-conflict@releases/2.x
25+
if: env.LABELING_TOKEN != '' && env.LABELING_TOKEN != null
26+
id: check
27+
with:
28+
dirtyLabel: "conflicting"
29+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
30+
continueOnMissingPermissions: true
31+
commentOnDirty: 'This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.'
32+
commentOnClean: 'Conflicts have been resolved. A maintainer will take a look shortly.'
33+
env:
34+
LABELING_TOKEN: ${{secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)
Please sign in to comment.