beemojs / conventional-pr-action Goto Github PK
View Code? Open in Web Editor NEWGitHub Action that validates the PR title and commits against a Conventional Commits preset.
GitHub Action that validates the PR title and commits against a Conventional Commits preset.
if I create an action and checkout a node/react/whatever project with a package.json file,
when this conventional-pr-action is run the package.json is modified, adding:
"dependencies": {
...
"conventional-changelog-beemo": "^3.0.1",
this is clearly undesirable.
I am not sure that this action is running correctly, can you confirm if it is supposed to install my npm dependencies given the config below:
name: Check PR title
on:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
lint_title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: beemojs/conventional-pr-action@v2
with:
require-multiple-commits: false
auto-install: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
If auto-install
is set to false does that mean that I need to manually install the beemo preset?
As title says, the action expects that a package.json is in the root folder, which is not always the case for monorepos. If a package.json is not found, creating one before running npm ci
would resolve this issue.
Hello and thanks for you work !
I found out that action fails when using valid commit types like feat
and refactor
. Is it normal ? Am I doing something wrong ?
I have a Kotlin Project so it do not have any package.json/package-lock.json and it crash due to a missing package-lock file
Run beemojs/conventional-pr-action@v2
with:
config-preset: angular
name: Conventionnal Commit
auto-install: true
config-version: latest
require-multiple-commits: false
env:
GITHUB_TOKEN: ***
Loading GitHub context and pull request
Installing dependencies with npm
/usr/local/bin/npm ci
npm ERR! The `npm ci` command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-01-03T11_31_21_000Z-debug.log
Error: The process '/usr/local/bin/npm' failed with exit code 1
[...]
if (getInput('require-multiple-commits') && pr.commits < 2)
[...]
getInput()
returns string so in case the configuration is require-multiple-commits: false
it will not work properly.
getBooleanInput()
should be used instead.
Steps to reproduce:
feat:
Actual result:
The validation fails.This does not happen for other valid prefixes, like ci:
or docs:
. See https://github.com/appium/appium-uiautomator2-driver/runs/8222140787?check_suite_focus=true
Expected result:
All prefixes defined at https://www.conventionalcommits.org/en/v1.0.0/ must be recognized as valid ones.
Hello
We use the following config for the action:
name: Conventional Commits
on:
pull_request:
jobs:
lint:
name: https://www.conventionalcommits.org
runs-on: ubuntu-latest
steps:
- uses: beemojs/conventional-pr-action@v2
with:
config-preset: angular
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Previously it was working without issue, but now the execution always fails with the following error:
Run beemojs/conventional-pr-action@v2
with:
config-preset: angular
auto-install: true
config-version: latest
require-multiple-commits: false
env:
GITHUB_TOKEN: ***
Loading GitHub context and pull request
Installing dependencies with npm
/usr/local/bin/npm install
up to date, audited 1 package in 271ms
found 0 vulnerabilities
Installing preset package conventional-changelog-angular@latest
/usr/local/bin/npm install conventional-changelog-angular@latest
added 5 packages, and audited 6 packages in 501ms
found 0 vulnerabilities
Loading preset package
Error: Preset "conventional-changelog-angular" does not exist.
See https://github.com/appium/java-client/actions/runs/8965038536/job/24617789030?pr=2167 for more details.
Is this a genuine issue or there's something we have done wrong in the pipeline config?
Hi,
Not sure if this is a user error (aka me) or bug, but if you do:
First, thanks for creating this Github Action!
I'm getting the following error: Error: PR title doesn't follow conventional changelog format.
with the following PR title ci(envs)!: some description here
and the following release.yml
:
on:
pull_request:
types: [opened, edited, synchronize, reopened]
name: ci
jobs:
conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.8.1'
- uses: beemojs/conventional-pr-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-preset: conventionalcommits
I believe I'm setting the preset correctly to conventionalcommits
and have also tried auto-install: false
with the preset in my devDependencies
but still get the same error. Any ideas?
FWIW, I tried conventional-commits-parser
on the same commit string via CLI and got the following response:
% conventional-commits-parser
ci(envs)!: some description here
{"type":null,"scope":null,"subject":null,"merge":null,"header":"ci(envs)!: some description here","body":null,"footer":null,"notes":[],"references":[],"mentions":[],"revert":null}
The type: null
part is suspect..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.