Skip to content

Commit

Permalink
ci: Fix reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chloe463 committed Dec 12, 2024
1 parent b736429 commit ac7bbea
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/reusable-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,45 @@ name: Reusable workflow example

on:
workflow_call:
# inputs:
# config-path:
# required: true
# type: string
# secrets:
# token:
# required: true
secrets:
NPM_TOKEN:
required: true

jobs:
lint:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/[email protected]
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/[email protected]
with:
node-version-file: ".node-version"
cache: "yarn"

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Restore cache for yarn and lerna
uses: actions/[email protected]
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
*/*/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run ESLint
run: |
BASE_BRANCH=${GITHUB_BASE_REF:-master}
Expand Down

0 comments on commit ac7bbea

Please sign in to comment.