Skip to content

Commit

Permalink
ci(dependabot): auto merge pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbasham committed Jan 23, 2024
1 parent ae35eab commit 19106f6
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 13 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
21 changes: 12 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,31 @@ assignees: ''
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
Steps to reproduce the behaviour:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: auto-merge
on:
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
if: github.triggering_actor == 'dependabot[bot]'
name: Auto merge pull requests
runs-on: ubuntu-latest
steps:
- name: Approve Dependabot PR
run: gh pr review --approve "${PR_URL}"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.MACHINE_TOKEN }}
- if: contains(github.event.pull_request.labels.*.name, 'github_actions')
name: Enable auto-merge for Dependabot PR
run: gh pr merge --auto --merge "${PR_URL}"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 15 additions & 3 deletions .github/workflows/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,20 @@ jobs:
run: npm install @commitlint/config-conventional
- name: Validate all commits
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose
yamllint:
name: Lint YAML documents
markdown-style:
name: Check markdown style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 19.x
- name: Validate markdown
run: npx markdownlint-cli2 **/*.md
yaml-style:
name: Check YAML style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -54,5 +66,5 @@ jobs:
python-version: "3.10"
- name: Install yamllint
run: pip install --user yamllint
- name: Lint
- name: Validate YAML
run: yamllint .
6 changes: 6 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"default": true,
"line-length": {
"tables": false
}
}
15 changes: 15 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# vi: ft=yaml
---
formatter:
type: basic
# There is a "bug" with the behaviour of this option that will move file head
# comments below the initial document start. For example front matter is
# rearraged and therefore misplaced in the file. This behaviour prevents
# `ymalfmt` from being run in CI or automatically in code editors.
include_document_start: true
indentless_arrays: true
pad_line_comments: 2
# There is missing functionality in `yamlfmt` to remove redundantly quoted
# strings from YAML documents, and prefer the use of double quotes (or
# whatever is configured). This means further manual effort is required to
# correct files.
2 changes: 2 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
---
extends: default
rules:
document-start:
level: error
indentation:
indent-sequences: false
spaces: 2
Expand Down

0 comments on commit 19106f6

Please sign in to comment.