Skip to content

Commit

Permalink
Added GH
Browse files Browse the repository at this point in the history
  • Loading branch information
bratanon committed Dec 4, 2023
1 parent 60c432c commit 97a6191
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @bratanon
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Dependabot configuration file:

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "bratanon"
ignore:
- dependency-name: '@types/node'
update-types:
- 'version-update:semver-major'
- 'version-update:semver-minor'
34 changes: 34 additions & 0 deletions .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot Pull Request Approve and Merge

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest

if: ${{ github.actor == 'dependabot[bot]' }}
steps:
# This first step will fail if there's no metadata and so the approval
# will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This sets the PR to allow auto-merging for patch and minor
# updates if all checks pass
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validate

on:
pull_request:
branches: [ master ]

jobs:
validate:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.16.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- run: npm lint
- run: npm test

0 comments on commit 97a6191

Please sign in to comment.