Skip to content

Commit

Permalink
update package-check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Oct 16, 2023
1 parent 109a6b8 commit 25769a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,42 @@ on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:

permissions:
contents: read

jobs:
package-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- uses: actions/checkout@v4

- name: Setup Node.js 18.x
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # pin@v3.4.1
- name: setup node
uses: actions/setup-node@v3.8.1
with:
node-version: 18.x
node-version-file: .node-version
cache: 'npm'

- name: Install dependencies
- name: install dependencies
run: npm ci

- name: Rebuild the dist/ directory
- name: rebuild the dist/ directory
run: npm run bundle

- name: Compare the expected and actual dist/ directories
- name: compare the expected and actual dist/ directories
run: |
if [ "$(git diff --text --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v2
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3.1.2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.6.0

0 comments on commit 25769a8

Please sign in to comment.