From 9aa77d681a85f248dd8732c31b6474f174b033f0 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Mon, 8 Jan 2024 22:02:19 +0100 Subject: [PATCH] Build on any changes to yarn.lock file We maybe want to add JS dependencies in PRs not only through dependabot PRs. --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e1ffd1e31..ae7ca9d83c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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