Skip to content

Fix multiline output in GitHub Actions workflows #68

Fix multiline output in GitHub Actions workflows

Fix multiline output in GitHub Actions workflows #68

Workflow file for this run

name: Build & push
on:
push:
branches-ignore: [ master ]
jobs:
build:
name: Build & push
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Get Yarn cache folder path
id: yarn-cache-folder
run: echo "path=$( yarn cache dir )" >> $GITHUB_OUTPUT
- name: Set up Yarn cache
id: yarn-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-folder.outputs.path }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node packages via Yarn
run: yarn install --frozen-lockfile --cache-folder ${{ steps.yarn-cache-folder.outputs.path }}
- name: Build
run: yarn build
- name: Check for changes
id: check-for-changes
run: |
{
echo "diff<<EOF"
git diff
echo "EOF"
} >> "$GITHUB_OUTPUT"
- if: ${{ steps.check-for-changes.outputs.diff != '' }}
name: Configure Git
run: |
git config user.email "[email protected]"
git config user.name $GITHUB_ACTOR
- if: ${{ steps.check-for-changes.outputs.diff != '' }}
name: Stage distribution directory
run: git stage ./dist
- if: ${{ steps.check-for-changes.outputs.diff != '' }}
name: Push the distribution file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit -m "Update distribution file"
git push --force "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" "HEAD:$GITHUB_REF"