Git Product home page Git Product logo

Comments (10)

JossWhittle avatar JossWhittle commented on June 16, 2024

@weizhangfd did you ever find a solution to this?

from action-conventional-commits.

lyager avatar lyager commented on June 16, 2024

.. just hit the same issue..

from action-conventional-commits.

pallabpain avatar pallabpain commented on June 16, 2024

Hitting the same issue with one of my repos. Albeit, it seems to work on a test repo that I created for the purpose of testing the action. I have a main branch and dev branch my action looks something like this

name: Check Commit Hygiene đŸ’Ŧ

on:
  pull_request:
    branches:
      - main
      - dev

jobs:
  verify:
    name: Conventional Commits
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v3
      name: Checkout code

    - uses: webiny/[email protected]
      name: Check if commit messages are compliant

from action-conventional-commits.

lyager avatar lyager commented on June 16, 2024

@pallabpain So, a PR from dev->main triggers an error if the commit messages are not convetional? My setup looks somewhat similar - but the error triggers on the main branch, when it's too late.

from action-conventional-commits.

pallabpain avatar pallabpain commented on June 16, 2024

@pallabpain So, a PR from dev->main triggers an error if the commit messages are not convetional? My setup looks somewhat similar - but the error triggers on the main branch, when it's too late.

You can take a look at this test repo that I created: https://github.com/pallabpain/conventional-commits-action

The main doesn't yet have the .github/workflows directory yet. Only devel has it and I raised a pull_request against devel. (https://github.com/pallabpain/conventional-commits-action/pull/1) and the action is detecting the commits.

However, with another repository with a similar branch structure, it's not detecting the commits.

Edit: FYI, I have deleted the test repo.

from action-conventional-commits.

JobaDiniz avatar JobaDiniz commented on June 16, 2024

I have a private repo and It's not working for me, and I get this warning:

Warning: Unexpected input(s) 'GITHUB_TOKEN', valid inputs are ['']

Run webiny/[email protected]
  with:
    GITHUB_TOKEN: ***
ℹī¸ Checking if commit messages are following the Conventional Commits specification...
No commits to check, skipping...
name: commit

on:
  pull_request:
    branches: [ develop ]

jobs:
  commits:
    name: check commit message
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Check message commit message
      uses: webiny/[email protected]
      with:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  label:
    needs: commits
    runs-on: ubuntu-latest
    steps:
      - uses: bcoe/conventional-release-labels@v1

from action-conventional-commits.

pallabpain avatar pallabpain commented on June 16, 2024

I have a private repo and It's not working for me, and I get this warning:

Warning: Unexpected input(s) 'GITHUB_TOKEN', valid inputs are ['']

Run webiny/[email protected]
  with:
    GITHUB_TOKEN: ***
ℹī¸ Checking if commit messages are following the Conventional Commits specification...
No commits to check, skipping...
name: commit

on:
  pull_request:
    branches: [ develop ]

jobs:
  commits:
    name: check commit message
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Check message commit message
      uses: webiny/[email protected]
      with:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  label:
    needs: commits
    runs-on: ubuntu-latest
    steps:
      - uses: bcoe/conventional-release-labels@v1

@JobaDiniz The fix was recently pushed to master. You are using the tag v1.1.0 which doesn't have the change.

from action-conventional-commits.

raimund-schluessler avatar raimund-schluessler commented on June 16, 2024

I do use the latest commit of this repo, but I still get the No commits to check, skipping... message with this actions file:

name: Conventional Commits

on:
  pull_request:
    branches: [ main ]

jobs:
  build:
    name: Check conventional commits
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: webiny/action-conventional-commits@8b3a60d2b73588beb378929c08f1a12116312bad
        # optional, required for private repos
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

from action-conventional-commits.

JobaDiniz avatar JobaDiniz commented on June 16, 2024

And it seems this library only check for type on the message.

I'm using this other gsactions/commit-message-checker@v2 lib that I can specify a regex. Would be good that this lib support regex or applied regex to the verification process.

check-commit-message:
    name: check commit message
    runs-on: ubuntu-latest
    steps:
    - name: Check message against regex
      uses: gsactions/commit-message-checker@v2
      with:
        pattern: '(?:build|docs|refactor|test|fix|perf|chore|feat)(?:\(\w+\))?:\s[a-z]{1,2}.+'
        error: "The commit message must follow the commit messages guidelines"
        excludeDescription: 'true' # optional: this excludes the description body of a pull request
        excludeTitle: 'true' # optional: this excludes the title of a pull request
        checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request
        accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true

from action-conventional-commits.

nathan-weinberg avatar nathan-weinberg commented on June 16, 2024

I believe I have this working as some folks in this thread want it to: https://github.com/transitmatters/mbta-slow-zone-bot/actions/workflows/commit.yml

Can see how I set it up here: https://github.com/transitmatters/mbta-slow-zone-bot/blob/main/.github/workflows/commit.yml

from action-conventional-commits.

Related Issues (4)

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.