5monkeys / cobertura-action

GitHub Action to report cobertura coverage
MIT License
63 stars 69 forks source link

Error: Not Found #64

Closed Asgaroth closed 2 years ago

Asgaroth commented 2 years ago

The action fails when running after a PR is merged.

After a PR is merged to the main branch we trigger a workflow. I have unsuccessfully tried skipping the Cobertura action in that case because it fails with Error: Not Found

Screen Shot 2021-12-13 at 4 09 38 PM

I am not sure exactly what is missing, it does perfectly on PRs

Relevant parts of the workflow

on:
  push:
    branches:
      - test/*
      - latest

  pull_request:
    branches:
      - latest
jobs:
  jest:
    needs: download-env
    runs-on: [self-hosted, linux, x64]

    steps:
      ... 
      - name: run unit tests
        run: npm run test-ci // > jest --ci --maxWorkers=2 --coverage --coverageReporters="cobertura"
      - name: coverage report
        uses: 5monkeys/cobertura-action@v12
        if: github.event_name == 'pull_request' && ${{ github.actor != 'dependabot[bot]' }}
        with:
          path: coverage/**/cobertura-coverage.xml
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          only_changed_files: true
          minimum_coverage: 40
          skip_covered: false

Output from run unit tests

Test Suites: 1 skipped, 110 passed, 110 of 111 total
Tests:       3 skipped, 582 passed, 585 total
Snapshots:   74 passed, 74 total
Time:        44.857 s
Ran all test suites.
📦 reporter is created on: /home/github/work/.../tmp/jest_html_reporters.html

Any ideas on how can I skip running this action after a merge? or what is it that the action is not finding?

Passing action during PR

Screen Shot 2021-12-13 at 4 23 48 PM

Asgaroth commented 2 years ago

Turns out I had a syntax issue

-- if: github.event_name == 'pull_request' && ${{ github.actor != 'dependabot[bot]' }}
++ if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'