Skip to content

Commit

Permalink
build(pr): dedicate step for uncommitted files check (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
nowseemee authored Apr 26, 2021
1 parent 265442c commit 4073d9f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ jobs:
run: |
yarn workspace @telekom/scale-components build
- name: Check for uncommitted changes
run: |
sh scripts/porcelain.sh
- name: Build Storybook
run: |
yarn workspace @telekom/scale-storybook-vue build --quiet
Expand All @@ -171,3 +167,38 @@ jobs:
with:
name: diff-output
path: packages/visual-tests/src/__image_snapshots__/__diff_output__

uncommitted-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Restore Lerna
id: yarn-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install project dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn

- name: Run Lerna bootstrap
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: |
yarn bootstrap
- name: Generate files
run: |
yarn lerna run generate
- name: Build Components
run: |
yarn workspace @telekom/scale-components build
- name: Check for uncommitted changes
run: |
sh scripts/porcelain.sh
8 changes: 3 additions & 5 deletions scripts/porcelain.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
source ./scripts/_colors.sh;
source ./scripts/_header.sh;
echo "--------"
echo "${GREEN}Check for uncommitted build outputs...${NC}"
echo "Check for uncommitted build outputs..."
echo "--------"
if [ -z $(git status --porcelain) ];
then
echo "${GREEN}Working copy is clean"
echo "Working copy is clean"
else
echo "${RED}Please commit your changes"
echo "Please commit your changes"
git status
exit 1
fi

0 comments on commit 4073d9f

Please sign in to comment.