Skip to content

Commit

Permalink
Build on any changes to yarn.lock file
Browse files Browse the repository at this point in the history
We maybe want to add JS dependencies in PRs not
only through dependabot PRs.
  • Loading branch information
tvdeyen committed Jan 8, 2024
1 parent d9b4f88 commit 9aa77d6
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
name: Build new JS packages
name: JS Build

on:
pull_request:
types: [opened, synchronize]

permissions:
contents: write
pull-requests: read
push:
branches:
- main

jobs:
Build:
if: ${{ github.actor == 'dependabot[bot]' }}
check_yarn_lock:
runs-on: ubuntu-latest
name: Check yarn.lock
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get all changed markdown files
id: changed-yarn-lock
uses: tj-actions/changed-files@v41
with:
files: yarn.lock
outputs:
yarn_lock_changed: ${{ steps.changed-yarn-lock.outputs.any_changed }}
build:
runs-on: ubuntu-latest
name: Build JS packages
needs: check_yarn_lock
if: ${{ needs.check_yarn_lock.outputs.yarn_lock_changed }}
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
Expand Down

0 comments on commit 9aa77d6

Please sign in to comment.