PINA icon indicating copy to clipboard operation
PINA copied to clipboard

Coverage workflow on PR

Open FilippoOlivo opened this issue 11 months ago • 4 comments

When a PR is opened from a forked repo to the mathLab/PINA, the coverage workflow fails. I leave here the reference of the error https://github.com/mathLab/PINA/actions/runs/14398808154/job/40379735408 .

Previous HEAD position was eacc3fc Merge 5454a82b4f9fef534adffc7d0d50756e54d6f7b9 into c71bc6421c2a436480bdf7d3e2e42fdd0df1d68d
Switched to a new branch '_xml_coverage_reports'
branch '_xml_coverage_reports' set up to track 'origin/_xml_coverage_reports'.
From https://github.com/mathLab/PINA
 * branch            _xml_coverage_reports -> FETCH_HEAD
Already up to date.
fatal: a branch named '_xml_coverage_reports' already exists
Copying data to /tmp/eacc3fce5642a5f334fd760e999d4538591029d9
Copying data from /tmp/eacc3fce5642a5f334fd760e999d4538591029d9
On branch _xml_coverage_reports
Your branch is up to date with 'origin/_xml_coverage_reports'.

nothing to commit, working tree clean
Run ad-m/github-push-action@master
Push to branch _xml_coverage_reports
remote: Permission to mathLab/PINA.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/mathLab/PINA.git/': The requested URL returned error: 403
Error: Invalid exit code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:30:21)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 128
}

FilippoOlivo avatar Apr 11 '25 08:04 FilippoOlivo

I think the problem is that the bot is trying to push to branch _xml_coverage_reports from the fork, but since PINA repo has securcy blocks (i.e. only mantainer can push to a PINA branch, contributor can only PR) what happens is that the fork is not able to push

dario-coscia avatar Apr 11 '25 08:04 dario-coscia

@ndem0 do you have any clue on how to fix this?

dario-coscia avatar Apr 29 '25 09:04 dario-coscia

Maybe https://github.com/marketplace/actions/code-coverage-summary or https://github.com/coverallsapp/github-action ?

dario-coscia avatar Sep 14 '25 17:09 dario-coscia

Fixed in https://github.com/mathLab/PINA/commit/9d465fc6672a8cf95c82295effe7e97e833db284. Changing the trigger event fixes the issue, since the Action has comments permission even triggered by forks with

on:
  pull_request_target:

ndem0 avatar Oct 13 '25 10:10 ndem0