Add pull request workflow

This commit is contained in:
William Brawner 2023-09-13 21:41:05 -06:00
parent 54c3ad8794
commit 12d5ca64b4
Signed by: wbrawner
GPG key ID: 8FF12381C6C90D35

40
.github/workflows/pull-request.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: Pull request workflow
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.13'
- name: Install Dependencies
run: npm install
- name: Test
run: npm run test
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: 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}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}