Coverage workflow on PR
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
}
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
@ndem0 do you have any clue on how to fix this?
Maybe https://github.com/marketplace/actions/code-coverage-summary or https://github.com/coverallsapp/github-action ?
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: