i will write action for github workflow to handle code lint in javascript. my action
name: Code Lint
on:
pull_request:
types: [opened, synchronize, ready_for_review]
workflow_dispatch:
jobs:
jslint:
name: JavaScript WordPress Lint
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.repository == 'organization/my-repo' || github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
ssh-key: ${{ secrets.SSH_KEY_FOR_SUBMODULE }}
persist-credentials: false
path: ./libs/submodule
- name: Setup Node.js and install dependencies
uses: ./.github/setup-node
- name: Running the lint:js
run: npm run lint:js
after run this action, i see 1 error. error is related with import statement of some files to use
my submodules!
because when running github action submodules not cloned into parent repository.
my parent and submodule repositories are private repository in github.
how to access to git submodule init && git submodule update
into CI?
Secrets Screenshot: Secrets Screenshot
forthermore i was added deploy key into submodule repository! like secret key
Please see the result: Action Results
please help me to run this action.