GithubHelp home page GithubHelp logo

Comments (5)

dreampulse avatar dreampulse commented on July 23, 2024

You mean you would lint the body / description of the PR message?

What would be a useful linting rule for the description?

from action-lint-pull-request-title.

dreampulse avatar dreampulse commented on July 23, 2024

@melink14 we could pass that as an additional option. Are you working on this?

name: "Lint PR Title"
on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: dreampulse/action-lint-pull-request-title@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LINT_BODY: true. # <---- new

from action-lint-pull-request-title.

melink14 avatar melink14 commented on July 23, 2024

You mean you would lint the body / description of the PR message?

What would be a useful linting rule for the description?

Exactly, the title of the PR is the title of the commit and the description of the PR is the body+footer of the commit. You would be able to enforce all the commitlint rules which are about body and footer (like line length and ending and blank lines)

Since in a squash+merge world, the PR is a single commit, it makes sense to treat PR description as addition commit message. Some tools like mergify also enable automatically using title+description as squash and merge commit!

Here's an example of a PR with this format: melink14/rikaikun#755

@melink14 we could pass that as an additional option. Are you working on this?

An additional option makes sense; I don't mind working on it. Could probably send a PR this weekend.

name: "Lint PR Title"
on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: dreampulse/action-lint-pull-request-title@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LINT_BODY: true. # <---- new

We could use a environment variable like this or we could add an explicit input to the workflow config. (Similar to this example). Using an explicit input would enable auto complete in editor's like VS Code but otherwise I don't have a strong opinion.

If the the option is true we can change

await validatePrTitle(pullRequest.title);

to

await validatePrTitle(pullRequest.title + '\n\n' + pullRequest.description);

(I didn't double check the description field but the idea is similar. )

We could update the validatePrTitle method name as well though it would work either way I think.

from action-lint-pull-request-title.

dreampulse avatar dreampulse commented on July 23, 2024

[..] Could probably send a PR this weekend.

Once you send a PR I'll integrate it into this action. We use that actions in a few bigger projects; I'll need to check if it doesn't break anything.
I'll appreciate your help :-)

from action-lint-pull-request-title.

melink14 avatar melink14 commented on July 23, 2024

Hi,

I made the change (melink14@725d38f) but I just realized that the commitlint config is hardcoded to the one in this repository and doesn't use the config in the repo which runs the action.

I'm thinking that it doesn't make as much sense to use this action directly given the expectation to edit the config in the action itself. (I didn't do enough research to figure out how easy it would be to default to user's config)

It might not be worth taking in the PR but let me know if you're still interested.

from action-lint-pull-request-title.

Related Issues (1)

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.