Skip to content

ci: change to use save-state #29

ci: change to use save-state

ci: change to use save-state #29

Workflow file for this run

name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
outputs:
result: ${{ steps.set-status.outputs.result }}
steps:
- name: Check if it's a repository creation event
id: set-status
run: |
if [ "${{ github.event_name }}" == 'push' ] && [ "${{ github.repository }}" != "${{ github.actor }}/express-api-template" ]; then
echo "Stopping job because it's a repository creation event."
echo "::save-state name=result::failure"
else
echo "Proceeding with the job."
echo "::save-state name=result::success"
fi
- name: Checkout code and Use Node.js
if: ${{ needs.build.outputs.result == 'success' }}
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
if: ${{ needs.build.outputs.result == 'success' }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
if: ${{ needs.build.outputs.result == 'success' }}
run: yarn install
- name: Lint
if: ${{ needs.build.outputs.result == 'success' }}
run: yarn lint
- name: Test and Coverage
if: ${{ needs.build.outputs.result == 'success' }}
run: yarn test:coverage