Skip to content

Commit

Permalink
add integrity check
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Oct 11, 2023
1 parent bb37e7d commit 1a0ff43
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Action
on:
workflow_dispatch:
inputs:
ref:
description: The branch
type: string
default: master
required: true
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: |
npm ci
- name: Build Action
run: |
npm run build
- name: Update dist
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add ./dist &&
git commit -m "Update dist"
git push origin HEAD:${{ inputs.ref }}
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,26 @@ jobs:
- run: npm run lint
- run: npm run test

dist-integrity:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Build action
run: |
npm ci &&
npm run build
- name: Dist Integrity Check
run: |
git diff --quiet dist
automerge:
needs: build
needs:
- build
- dist-integrity
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"build": "ncc build src/index.js",
"lint": "eslint .",
"git:add:dist": "git add dist",
"test": "tap"
},
"author": {
Expand Down Expand Up @@ -43,6 +44,7 @@
"pre-commit": [
"lint",
"test",
"build"
"build",
"git:add:dist"
]
}

0 comments on commit 1a0ff43

Please sign in to comment.