From b6ed74f0ee86ff1fef7f8f18ce776214e7f0f17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Tue, 25 Jan 2022 20:26:31 +0100 Subject: [PATCH] Don't fail PRs if dist outdated This removes the step for everything but the main branch. On the main branch, we instead auto-update dist, so we can still merge PRs that forgot to update dist. --- .github/workflows/build.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbd94ba..67badfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,8 @@ on: [push, pull_request] jobs: build: runs-on: ubuntu-latest + permissions: + contents: write env: NIX_PATH: nixpkgs=channel:nixpkgs-unstable steps: @@ -33,12 +35,14 @@ jobs: - name: Build run: yarn build - - name: Check dist + - name: Update dist + if: github.repository_owner == 'stephank' && github.ref == 'refs/heads/main' run: | - if [[ "$(git status --porcelain)" != "" ]]; then - echo "Build in dist/ is outdated" - exit 1 - fi + [[ "$(git status --porcelain)" != "" ]] || exit + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git commit -m 'Update dist' dist/yarn-plugin-nixify.js + git push - name: Install plugin run: yarn plugin import ./dist/yarn-plugin-nixify.js