ArtiomTr/jest-coverage-report-action

Cannot checkout branch from private fork

ddlan opened this issue · 0 comments

ddlan commented

Describe a bug

When raising a PR to a repo from a private fork, the github action fails when trying to check out the PR branch because it does not have access to the private remote.

Expected behavior

The github action should be able to check out the PR HEAD commit by hash and run test coverage.

Details

  • Action version: v2.2.4
  • OS, where your action is running (windows, linux): linux
  • action.yml file
name: Coverage report
on:
  pull_request:
    branches:
      - master
jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - run: |
          git fetch --no-tags --depth=1 origin master
          git checkout -b master
          git checkout ${{ github.event.pull_request.head.sha }}
      - uses: ArtiomTr/jest-coverage-report-action@v2.2.4
        with:
          package-manager: yarn
          github-token: ${{ secrets.GITHUB_TOKEN }}
          working-directory: ./webserver
          test-script: yarn jest --changedSince=master --silent
</details>
  • Screenshots
image image
</details>

Additional context