Giter Site home page Giter Site logo

Comments (2)

ldez avatar ldez commented on August 19, 2024

Golangci-lint is already triggered when a PR is created or updated.

Documentation about pull_request_review event.


  • prevent any malicious code from triggering your GitHub Actions

This should be handled inside the GitHub repository configuration.
https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks


  • cuts down the total billable minutes (since you're only running lints on pull request approvals and not on every update to the PR)

This only applies to private repositories so your first argument doesn't fit.
Anyway, pull_request_review is not for approval but for reviews.

Even if you restrict only on approval (i.e. submitted + if: github.event.review.state == 'APPROVED'), this means you will approve a PR without having the result of the linting, this doesn't make sense.

If you think of another activity type (ex: edited), it's the same thing but worse.

To cut down the total billable minutes:

  • run golangci-lint locally before a push (and before a commit), the cache will do the job.
  • don't push half-done work

You want to launch golangci-lint on demand but your proposal (pull_request_review) is a bad approach.

from golangci-lint-action.

humancalico avatar humancalico commented on August 19, 2024

You want to launch golangci-lint on demand but your proposal (pull_request_review) is a bad approach.

@ldez Would love to hear any alternatives you have in mind

from golangci-lint-action.

Related Issues (20)

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.