Skip to content

Commit

Permalink
feat(github-action): Update workflow working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvassallo committed May 23, 2024
1 parent 47e8ea5 commit f621a0f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 68 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# In TypeScript actions, `action/dist/` is a special directory. When you reference
# an action with the `uses:` property, `action/dist/index.js` is the code that will be
# run. For this project, the `action/dist/index.js` file is transpiled from other
# source files. This workflow ensures the `action/dist/` directory contains the
# In TypeScript actions, `dist/` is a special directory. When you reference
# an action with the `uses:` property, `dist/index.js` is the code that will be
# run. For this project, the `dist/index.js` file is transpiled from other
# source files. This workflow ensures the `dist/` directory contains the
# expected transpiled code.
#
# If this workflow is run from a feature branch, it will act as an additional CI
# check and fail if the checked-in `action/dist/` directory does not match what is
# check and fail if the checked-in `dist/` directory does not match what is
# expected from the build.
name: Check Transpiled JavaScript For Action
name: Check Transpiled JavaScript

on:
pull_request:
Expand All @@ -24,9 +24,11 @@ permissions:

jobs:
check-dist:
name: Check action/dist/
name: Check dist/
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./action
steps:
- name: Checkout
id: checkout
Expand All @@ -43,32 +45,32 @@ jobs:
id: install
run: npm ci

- name: Build action/dist/ Directory
- name: Build dist/ Directory
id: build
run: npm run bundle

# This will fail the workflow if the `action/dist/` directory is different than
# This will fail the workflow if the `dist/` directory is different than
# expected.
- name: Compare Directories
id: diff
run: |
if [ ! -d action/dist/ ]; then
echo "Expected action/dist/ directory does not exist. See status below:"
if [ ! -d dist/ ]; then
echo "Expected dist/ directory does not exist. See status below:"
ls -la ./
exit 1
fi
if [ "$(git diff --ignore-space-at-eol --text action/dist/ | wc -l)" -gt "0" ]; then
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text action/dist/
git diff --ignore-space-at-eol --text dist/
exit 1
fi
# If `action/dist/` was different than expected, upload the expected version as a
# If `dist/` was different than expected, upload the expected version as a
# workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: action-dist
path: action/dist/
name: dist
path: dist/
51 changes: 0 additions & 51 deletions .github/workflows/linter.yml

This file was deleted.

File renamed without changes.

0 comments on commit f621a0f

Please sign in to comment.