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.
This commit is contained in:
@@ -5,6 +5,8 @@ on: [push, pull_request]
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
env:
|
env:
|
||||||
NIX_PATH: nixpkgs=channel:nixpkgs-unstable
|
NIX_PATH: nixpkgs=channel:nixpkgs-unstable
|
||||||
steps:
|
steps:
|
||||||
@@ -33,12 +35,14 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build
|
run: yarn build
|
||||||
|
|
||||||
- name: Check dist
|
- name: Update dist
|
||||||
|
if: github.repository_owner == 'stephank' && github.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
if [[ "$(git status --porcelain)" != "" ]]; then
|
[[ "$(git status --porcelain)" != "" ]] || exit
|
||||||
echo "Build in dist/ is outdated"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
exit 1
|
git config user.name "github-actions[bot]"
|
||||||
fi
|
git commit -m 'Update dist' dist/yarn-plugin-nixify.js
|
||||||
|
git push
|
||||||
|
|
||||||
- name: Install plugin
|
- name: Install plugin
|
||||||
run: yarn plugin import ./dist/yarn-plugin-nixify.js
|
run: yarn plugin import ./dist/yarn-plugin-nixify.js
|
||||||
|
|||||||
Reference in New Issue
Block a user