-2

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.

rezaelahi
  • 1
  • 1
  • i do to fix this problem try to change my steps: ``` - name: Setup SSH uses: MrSquaare/ssh-setup-action@v1 with: host: github.com private-key: ${{ secrets.SSH_PRIVATE_KEY }} ``` i'm fix permission denied with `MrSquaare/ssh-setup-action@v1` – rezaelahi Aug 08 '23 at 14:13

0 Answers0