coroo / pytest-coverage-commentator

A Github action to comments a Pytest Coverage on PR
MIT License
45 stars 16 forks source link

**Workflow failed! Resource not accessible by integration** for the first time #153

Open rabinadk1 opened 2 years ago

rabinadk1 commented 2 years ago

I get the resource not accessible error for every first time the action is run. When I re-run it, it works well. It has become annoying to rerun it every time for each PR.

I have attached the workflow file below.

# This workflow will install Python dependencies, run tests, and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Comment Backend Coverage Report

on:
  pull_request:
    branches: [ main ]
    paths:
        - 'server/**'

jobs:
  build:

    runs-on: ubuntu-latest
    defaults:
       run:
         working-directory: server/

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: "3.10"
        cache: pip
        cache-dependency-path: server/
    - name: Install dependencies
      run: |
        pip install -r requirements.txt
        pip install pytest-cov
    - name: Build coverage file
      run: |
        pytest --cov=app test | tee ../pytest-coverage.txt
      env:
        JWT_SECRET_KEY: ${{ github.sha }}
    - name: Comment coverage
      uses: coroo/pytest-coverage-commentator@v1.0.2
TfedUD commented 2 years ago

following

kahnwong commented 1 year ago

I have tested my actions file with below permissions setting and it works.

    permissions:
      pull-requests: write
grigoriev-semyon commented 1 year ago

I think this issue is very similar to #30