Skip to content

Commit

Permalink
Automatically update dist files for Dependabot bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Feb 21, 2022
1 parent 7956a97 commit dbe2b76
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/dependabot-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Compile dependabot updates

on:
workflow_dispatch:
pull_request_target:

permissions:
pull-requests: write
contents: write
jobs:
fetch-dependabot-metadata:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Fetch dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
build-dependabot-changes:
runs-on: ubuntu-latest
needs: [fetch-dependabot-metadata]
if: ${{ needs.fetch-dependabot-metadata.outputs.dependency-type == 'direct:production' }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Install NPM dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run package

- name: Check in any change to dist/
run: |
git add dist/
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "[dependabot skip] Update dist/ with build changes" || exit 0
git push

0 comments on commit dbe2b76

Please sign in to comment.