GithubHelp home page GithubHelp logo

go-coverage-action's People

Contributors

dependabot[bot] avatar gwatts avatar jacklee1792 avatar khasanovbi avatar marians avatar raleksandar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

go-coverage-action's Issues

Permission issue

I'm currently trying to setup coverage in a project, and I have a problem with the github-actions bot unable to push arbitrary notes:

new coverage raw data
  new coverage data:  {"go-coverage-action-fmt":1,"coverage_pct":61.19733924611973,"pkg_stats":{"github.com/autometrics-dev/autometrics-go/internal/autometrics":[95.23809523809523],"github.com/autometrics-dev/autometrics-go/internal/generate":[75.81227436823104],"github.com/autometrics-dev/autometrics-go/pkg/autometrics":[40],"github.com/autometrics-dev/autometrics-go/pkg/autometrics/prometheus":[0]},"skipped_count":0}
$ git fetch origin +refs/notes/gocoverage:refs/notes/gocoverage
  fatal: couldn't find remote ref refs/notes/gocoverage
  Warning: Failed to run git fetch origin +refs/notes/gocoverage:refs/notes/gocoverage
no existing gocoverage ref
$ git notes --ref=gocoverage add -f --file=- f407a54d98c74168aa4e88801c88bf20439ef3bc
$ git push origin refs/notes/gocoverage
  remote: Permission to autometrics-dev/autometrics-go.git denied to github-actions[bot].
  fatal: unable to access 'https://github.com/autometrics-dev/autometrics-go/': The requested URL returned error: 403
  Warning: Failed to run git push origin refs/notes/gocoverage
Error: Error: Command failed with exit code 128: git push origin refs/notes/gocoverage
remote: Permission to autometrics-dev/autometrics-go.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/autometrics-dev/autometrics-go/': The requested URL returned error: 403

I'm assuming that some of the errors happen because:

  • there's no previous coverage data on main, and
  • I don't have the authorization to push directly on main (as it's a protected branch)

What's the exact permissions I need to setup if I want to make that work? I really just used the minimal example:

name: "Go Coverage"
on:
  pull_request:
  push:
    branches:
      - main

jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 10

    - uses: gwatts/go-coverage-action@v1
      id: coverage
      with:
        cover-pkg: ./...

coverage reports attached to merge commits on pull requests

I was experimenting with this action to include it in my workflows. As I was testing with the pull_request event, I realised that the git notes that the action is adding ( by the way, kudos on using git notes for storing coverage reports. It is a cool and neat use of the feature 👏 🎉 ), is being added to merge commits and not to the last commit in the pull request.

image

I tried to checkout github.head_ref in actions/checkout in a vain attempt to see if that would make a difference, but it did not.

image


Upon inspecting the code further, I noticed that the note was being added to github.context.sha

'-f', '--file=-', ctx.sha], jsdata);

which, according to the documentation for GitHub Actions, points to the Last merge commit on the GITHUB_REF branch.

This means that there would never be priorCoverage unless there is a companion action run on:push event as well which will push coverage reports on the actual commits on the branch.

Can we instead, push the note to the last commit in the pull request so that the notes are always available?

I am not sure whether the context payload

const pl = ctx.payload;

would have something like pl.pull_request.head.sha; but if it does, can we target that please? That way, we would not have to have another action that targets on:push events as well in order for the on:pull_request workflows work reliably.

Test execution timed out after 10m

I have a module using go-coverage-action and tests for which generally take longer than 10m, is there anyway I can configure go test timeouts with this plugin ?

Test execution timed out after 10m

I have a module using go-coverage-action and tests for which generally take longer than 10m, is there anyway I can configure go test timeouts with this plugin ?

Upgrade NodeJS

GitHub actions has deprecated NodeJSS v16. Running the action in version 1.3.0 emits this message:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: gwatts/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Many actions we use have released this type of change as a new major release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.