Code Monkey home page Code Monkey logo

conventional-changelog-action's Introduction

Conventional Changelog action

This action will bump version, tag commit and generate a changelog with conventional commits.

Inputs

  • Optional github-token: Github token, if different permissions required than from checkout.
  • Optional git-message: Commit message that is used when committing the changelog.
  • Optional git-user-name: The git user.name to use for the commit. Default Conventional Changelog Action
  • Optional git-user-email: The git user.email to use for the commit. Default [email protected]
  • Optional git-pull-method: The git pull method used when pulling all changes from remote. Default --ff-only
  • Optional git-push: Push all the GIT changes. Default true
  • Optional git-branch: The branch used to push. Default is the current branch (${{ github.ref }})
  • Optional git-url: Git repository domain. Default is github.com
  • Optional git-path: Path filter for the logs and version. If set, only commits that match the path filter will be considered. By default, we won't use this feature(empty string).
  • Optional preset: Preset that is used from conventional commits. Default is angular (learn more about presents here)
  • Optional tag-prefix: Prefix for the git tags. Default v.
  • Optional input-file: Read the changelog from this file. This will prepend the newly generated changelogs to the file's content.
  • Optional output-file: File to output the changelog to. Default CHANGELOG.md, when providing 'false' no file will be generated / updated.
  • Optional release-count: Number of releases to preserve in changelog. Default 5, use 0 to regenerate all. This input has no effect if input-file is used.
  • Optional version-file: The path to the file that contains the version to bump (supports comma-separated list of file paths). Default ./package.json. Other supported formats are mix.exs, .toml, .yml, .yaml, and .json.
  • Optional version-path: The place inside the version file to bump. Default version.
  • Optional skip-git-pull: Do not pull the repo before tagging. Ensure you full cloned the repo in the first place to get tags. Default 'false'.
  • Optional skip-on-empty: Boolean to specify if you want to skip empty release (no-changelog generated). This case occurred when you push chore commit with angular for example. Default 'true'.
  • Optional skip-version-file: Do not update the version file. Default 'false'.
  • Optional skip-commit: Do not create a release commit. Default 'false'.
  • Optional skip-tag: Do not tag the release. Helpful for using action to check if a release is going to be made. Default 'false'.
  • Optional pre-commit: Path to the pre-commit script file. No hook by default.
  • Optional fallback-version: The fallback version, if no older one can be detected, or if it is the first one. Default '0.1.0'. If pre-releaseis set to true it will default to the configured pre-release format (i.e. '0.1.0-rc.0')
  • Optional config-file-path: Path to the conventional changelog config file. If set, the preset setting will be ignored
  • Optional pre-changelog-generation: Path to the pre-changelog-generation script file. No hook by default.
  • Optional skip-ci: Adds instruction to Github to not consider the push something to rebuild. Default true.
  • Optional create-summary: Adds the generated changelog as Action Summary. Default false.
  • Optional pre-release: Marks the release as pre-release. Default false.
  • Optional pre-release-identifier: The identifier to use for the pre-release. Default rc.
  • Optional skip-bump: Prevents the action from bumping the version.

Presets

This action comes pre-compiled with the angular (default) and conventionalcommits, if you wish to use an other preset you need to make sure it's installed with npm install conventional-changelog-<preset name>

Pre-Commit hook

Function in a specified file will be run right before the git-add-git-commit phase, when the next version is already known and a new changelog has been generated. You can run any chores across your repository that should be added and committed with the release commit.

Specified path could be relative or absolute. If it is relative, then it will be based on the GITHUB_WORKSPACE path.

Script should:

  • be a CommonJS module
  • have a single export: exports.preCommit = (props) => { /* ... */ }
  • not have any return value
  • be bundled (contain all dependencies in itself, just like the bundled webapp)

preCommit function can be async.

Following props will be passed to the function as a single parameter:

interface Props {
  tag: string; // Next tag e.g. v1.12.3
  version: string; // Next version e.g. 1.12.3
}

export function preCommit(props: Props): void {}

A bunch of useful environment variables are available to the script with process.env. See docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables to learn more.

Pre-Changelog-Generation hook

Function in a specified file will be run right before the changelog generation phase, when the next version is already known, but it was not used anywhere yet. It can be useful if you want to manually update version or tag.

Same restrictions as for the pre-commit hook, but exported functions names should be preVersionGeneration for modifications to the version and preTagGeneration for modifications to the git tag.

Following props will be passed to the function as a single parameter and same output is expected:

// Next version e.g. 1.12.3
export function preVersionGeneration(version: string): string {}

// Next tag e.g. v1.12.3
export function preTagGeneration(tag: string): string {}

Config-File-Path

A config file to define the conventional commit settings. Use it if you need to override values like issuePrefix or issueUrlFormat. If you set a config-file-path, the preset setting will be ignored. Therefore use an existing config and override the values you want to adjust.

example:

'use strict'
const config = require('conventional-changelog-conventionalcommits');

module.exports = config({
    "issuePrefixes": ["TN-"],
    "issueUrlFormat": "https://jira.example.com/browse/{{prefix}}{{id}}"
})

The specified path can be relative or absolute. If it is relative, then it will be based on the GITHUB_WORKSPACE path.

Make sure to install all required packages in the workflow before executing this action.

Outputs

  • changelog: The generated changelog for the new version.
  • clean_changelog: The generated changelog for the new version without the version name in it (Better for Github releases)
  • version: The new version.
  • tag: The name of the generated tag.
  • skipped: Boolean ('true' or 'false') specifying if this step have been skipped

Example usages

Uses all the defaults

permissions:
  contents: write

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}

Write permissions are required in order to enable git push when a new version is generated. In some configurations, the default secrets.github_token may not have the correct permissions. You can check your default permissions by looking at "Set up job" section of your GitHub action run log.

Overwrite everything

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    git-message: 'chore(release): {version}'
    git-user-name: 'Awesome Changelog Action'
    git-user-email: '[email protected]'
    preset: 'angular'
    tag-prefix: 'v'
    output-file: 'MY_CUSTOM_CHANGELOG.md'
    release-count: '10'
    version-file: './my_custom_version_file.json' // or .yml, .yaml, .toml, mix.exs
    version-path: 'path.to.version'
    skip-on-empty: 'false'
    skip-version-file: 'false'
    skip-commit: 'false'
    git-branch: 'my-maintenance-branch'

No file changelog

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    output-file: "false"

Tag only

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    skip-commit: "true"

Skip Git Pull In CI you might not want to pull extra changes before tagging e.g. if running a long build before tagging, another commit may have come into the branch which would get pulled leading to tagging a different commit to the one which was built.

- name: Checkout repository
  uses: actions/checkout@v4
  with:
    fetch-depth: 0

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    skip-git-pull: "true"

Use a custom file for versioning

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    version-file: "my-custom-file.yaml"

Use a pre-commit hook

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    pre-commit: some/path/pre-commit.js

Github releases

- name: Conventional Changelog Action
  id: changelog
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ${{ secrets.github_token }}
    output-file: "false"

- name: Create Release
  uses: actions/create-release@v1
  if: ${{ steps.changelog.outputs.skipped == 'false' }}
  env:
    GITHUB_TOKEN: ${{ secrets.github_token }}
  with:
    tag_name: ${{ steps.changelog.outputs.tag }}
    release_name: ${{ steps.changelog.outputs.tag }}
    body: ${{ steps.changelog.outputs.clean_changelog }}

Use a deploy key

If you want to trigger another GitHub action based on pushed tag, you can use Deploy Key, To make full use of the Deploy Key, you must set the value of github-token input to empty string.

- name: Checkout GitHub Action
  uses: actions/checkout@v4
  with:
    ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}
- name: Conventional Changelog Action
  id: changelog
  uses: TriPSs/conventional-changelog-action@v5
  with:
    github-token: ""

Development

If you'd like to contribute to this project, all you need to do is clone and install act this project and run:

Note: The image used is 18 gb!

$ npm install

# To run / test one specific job
$ act -j <workflow job name> -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 --quiet
# Example
$ act -j test-json -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 --quiet

# To run all tests
$ act pull_request -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 --quiet

Conventional Changelog Action is MIT licensed.

Collaboration

If you have questions or issues, please open an issue!

conventional-changelog-action's People

Contributors

almogbaku avatar andresmatasuarez avatar apr-1985 avatar asgerjensen avatar binomialstew avatar dependabot[bot] avatar devscyu avatar dgusakov avatar dhpagani avatar iloveitaly avatar janro1 avatar jayrgo avatar jeronimoek avatar justin-elias avatar kamronbatman avatar kurnev avatar nagarian avatar pdreker avatar skhomuti avatar tomfrenken avatar tripss avatar viktor-ku avatar xsc27 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

conventional-changelog-action's Issues

Changing prefix seem to scramble version number

Hi,

I'm testing out using this action for automated version bumping for our (work) repo, using my personal test repo.

I discovered that when changing the prefix here, the version number seem to be reset or scrambled, as you can see here.

The sequence of events are:

  • initially I started with no prefix, and 1.0.0 in VERSION.json. It works as intended (1.0.0-1.0.13) until
  • I changed the prefix to vv for testing, then the version number "rolled" back to vv1.0.3, which is 10 back from 1.0.13, seeing that, I experimented more by
  • changing the prefix from vv to lrp_, now the version becomes lrp_0.1.0, and the release page places that before the vv* releases

In addition, the VERSION.json file seem to have stopped being updated after I changed to skip-commit: 'true'. Is this intended, and/or related?

Thanks!
Steve

package.json not getting version update

Hello guys!
Any clue why TriPSs/conventional-changelog-action@v3 is updating the version only inside the package-lock.json and is ignoring the package.json file?

Below my workflow definition:

name: Bump version
on:
  push:
    branches:
      - master
    paths-ignore:
      - 'package.json'
      - 'CHANGELOG.md'
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.ACTION_TOKEN }}
    - name: Bump version and push tag
      uses: TriPSs/conventional-changelog-action@v3
      with:
        github-token: ${{ secrets.ACTION_TOKEN }}
        git-message: 'chore(release): {version}'
        preset: 'angular'
        tag-prefix: ''
        output-file: 'CHANGELOG.md'
        skip-on-empty: true
        version-file: 'package.json, package-lock.json'

Git push with LFS

My version-file is tracked by LFS. I know it's weird but my version file is a .asset file in Unity and there are some other big .asset files so I need to do this.

After the action, the reference is pushed correctly, but when I want to checkout the new commit I get an error because the object does not exist:

Downloading Project/ProjectSettings/ProjectSettings.asset (21 KB)
Error downloading object: Project/ProjectSettings/ProjectSettings.asset (2a0c91c): Smudge error: Error downloading Project/ProjectSettings/ProjectSettings.asset (2a0c91c166259d18151ed53c89e8ad8676c428dae2a6ea70c0dfb8a498ca3272): [2a0c91c166259d18151ed53c89e8ad8676c428dae2a6ea70c0dfb8a498ca3272] Object does not exist on the server: [404] Object does not exist on the server

Errors logged to /home/user/Projects/Project/.git/lfs/logs/20200829T000520.913474364.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: Project/ProjectSettings/ProjectSettings.asset: smudge filter lfs failed

I tried adding a git lfs push origin ${branch} after the normal push in this action but it didn't work. Need to dive deeper into this.

Yaml does not support double quotes or no quotes

I have a flutter project with a so called pubspec.yaml, which by default specifies the version without quotes.

In the code the yaml.js file the replace function expects single quotes. Yaml usually doesn't care if it is single, double or no quotes.

Issue with git pull

Got this error.

You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

Error: The process '/usr/bin/git' failed with exit code 1

It was run on PR.

Whole action file

name: Version and changelog

on:
  pull_request:
    branches: [ master, develop ]

jobs:
  version:
      name: version
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v2
      - uses: TriPSs/conventional-changelog-action@v3
        with:
          push-branch: ${{ steps.extract_branch.outputs.branch }}
          github-token: ${{ secrets.github_token }}
          git-message: 'chore(release): {version}'
          git-user-name: 'Awesome Changelog Action'
          git-user-email: '[email protected]'
          preset: 'angular'
          tag-prefix: 'v'
          release-count: '0'

Do custom configs actually work?

Hi there, I'm trying to use a custom config but the changelog will not generate for some reason. Do you have any insight?

If I understand correctly, setting the below config should mean that the changelog contains commits with the following messages that are not set to hidden.

config:

'use strict'
const config = require('conventional-changelog-conventionalcommits');

module.exports = config({
    "types": [
        { type: 'feat', section: 'Features' },
        { type: 'fix', section: 'Bug Fixes' },
        { type: 'perf', section: 'Performance' },
        { type: 'revert', section: 'Reverts' },
        { type: 'build', section: 'Build System' },
        { type: 'ci', section: 'Continuous Integration' },
        { type: 'refactor', section: 'Code Refactoring' },
        { type: 'chore', section: 'Chores' },
        { type: 'docs', section: 'Documentation' },
        { type: 'style', section: 'Styles' },
        { type: 'test', section: 'Tests' },
        { type: 'wip', section: 'WIP', hidden: true },
        { type: 'hide', section: 'Hidden', hidden: true },
        { type: 'release', section: 'Releases', hidden: true },
    ]
})

workflow:

- name: Changelog
  uses: TriPSs/conventional-changelog-action@v3
  with:
    github-token: ${{secrets.github_token}}
    git-message: 'chore(release): {version}'
    git-user-name: 'XXX'
    git-user-email: 'XXX'
    release-count: '0'
    config-file-path: ./changelog.config.js

Yet, in the action output, we get:

Using "" preset
Using "./changelog.config.js" as config file

...

Generated changelog is empty and skip-on-empty has been activated so we skip this step

Despite having the following dummy commits that I have setup:

@adxmcollins
chore: update presets

@adxmcollins
ci: update CI

@adxmcollins
build: update automatic build

@adxmcollins
chore: update

The changelog generates fine for feat and fix commits, so it seems like it is just ignoring the config I set and using the default one.

Failing when using git tags only

I'm using this action with a golang service that I've built, so I'm trying to configure the action to use tags rather than a file, I've setup the following step in my workflow.

      - name: Conventional Changelog Action
        id: changelog
        uses: TriPSs/conventional-changelog-action@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          output-file: 'false'
          skip-commit: 'true'

It's a clean repository, I've tried running without any existing tags and I've also tried pushing a v0.0.0 tag to a previous commit too, but it always seems to result in the following error:

Using "v" as tag prefix
Using "false" as output file
Skipping empty releases is "enabled"
Skipping the update of the version file is "disabled"
Pull to make sure we have the full git history
/usr/bin/git remote set-url origin ***github.com/******/service-registration.git
/usr/bin/git pull --unshallow --ff-only
From https://github.com/******/service-registration
 * [new branch]      build/test           -> origin/build/test
 * [new branch]      feature/initial      -> origin/feature/initial
 * [new branch]      feature/registration -> origin/feature/registration
Already up to date.
Recommended release type: minor
Because: There are 0 BREAKING CHANGES and 1 features
Using GIT to determine the new version
/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/src/version/git.js:16
        const currentVersion = tags.shift().replace(tagPrefix, '')
                                           ^

TypeError: Cannot read property 'replace' of undefined
    at /home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/src/version/git.js:16:44
    at /home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/git-semver-tags/index.js:59:5
    at ChildProcess.exithandler (child_process.js:286:7)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Doesn't update package-lock.json

Cheers for the action. Couple of things I noticed... this currently leaves package-lock.json untouched - shouldn't it update the version in that too? Also, it removes the newline at the end of the file when writing back to package.json.

version-file extension not supported even if it's YML inside

I'm using this action in a Unity project.
Unity keeps the version number in a file named "ProjectSettings.asset". It's just an YML with a custom extension.
And as you can see I'm getting the following error when it tries to use that file.

    at handleVersioningByExtension (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/src/index.js:15:11)```

Maybe it would be useful to specify an optional input `version-file-type` so that it uses that format instead of inferring it from extension? And if no type is specified, just work as it's been working.

Option to append (preserve) old changelog

I have an old manual changelog, but I now want to automate the changelog generation, while keeping the old changelog.

conventional-commits package has such an option, but this option is to be used by the parent plugin, which is this github action.

This module has options append and releaseCount. However, it doesn't read your previous changelog. Reasons being:

  1. The old logs is just to be appended or prepended to the newly generated logs, which is a very simple thing that could be done in the parent module.
  2. We want it to be very flexible for the parent module. You could create a readable stream from the file or you could just read the file.
  3. We want the duty of this module to be very minimum.

From conventional-changelog-core

So adding a line which appends to the old changelog would be awesome.

Error when merging pull request: pathspec did not match any file(s) known to git

Hi,

Thanks for this action!
I'm getting an error while merging my pull request into a branch.

name: Bump version
on:
  pull_request:
      branches: [ development, master-dev ]
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.github_token }}
    - name: Bump version and push tag
      uses: TriPSs/conventional-changelog-action@v2
      with:
        github-token: ${{ secrets.github_token }}
        git-message: 'chore(release): {version}'
        tag-prefix: 'v'
        output-file: 'CHANGELOG.md'

The error:

Run TriPSs/conventional-changelog-action@v2
Using "angular" preset
Using "chore(release): {version}" as commit message
Using "5" release count
Using "./package.json"
Using "v" as tag prefix
Using "CHANGELOG.md" as output file
Pull to make sure we have the full git history
/usr/bin/git config user.name Conventional Changelog Action
/usr/bin/git config user.email [email protected]
/usr/bin/git remote set-url origin ***github.com/my-repo.git
/usr/bin/git checkout refs/pull/14/merge
/usr/bin/git pull --unshallow
error: pathspec 'refs/pull/14/merge' did not match any file(s) known to git
(node:2489) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v2/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v2/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v2/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)

Action passes on exception

The action appears to exit 0 even when an expectation is thrown. (I forgot to checkout the repo, so the root cause is "user error". The action should still not exit 0 and allow CI to continue.)

Run TriPSs/conventional-changelog-action@v3
  with:
    github-token: ***
    skip-commit: true
    git-message: chore(release): {version}
    git-user-name: Conventional Changelog Action
    git-user-email: [email protected]
    git-pull-method: --ff-only
    preset: angular
    tag-prefix: v
    output-file: CHANGELOG.md
    release-count: 5
    version-file: ./package.json
    version-path: version
    skip-on-empty: true
    skip-version-file: false
    fallback-version: 0.1.0
(node:1440) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:1440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1440) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1440) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
(node:1440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1440) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
(node:1440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:1440) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
(node:1440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
Using "angular" preset
Using "chore(release): {version}" as commit message
Using "Conventional Changelog Action" as git user.name
Using "[email protected]" as git user.email
Using "5" release count
Using "./package.json" as version file
Using "version" as version path
Using "v" as tag prefix
Using "CHANGELOG.md" as output file
Using "" as config file
Skipping empty releases is "enabled"
Skipping the update of the version file is "disabled"
Pull to make sure we have the full git history
/usr/bin/git config user.name Conventional Changelog Action
/usr/bin/git config user.email [email protected]
/usr/bin/git remote set-url origin ***github.com/---/neptune-trident.git
/usr/bin/git rev-parse --is-shallow-repository
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not in a git directory
fatal: not in a git directory

Cannot find module '@actions/core'

Hej.

While trying to set up this action correctly, I run into the following issue:

Run TriPSs/conventional-changelog-action@master
internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/TriPSs/conventional-changelog-action/master/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/master/src/index.js:1:14)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/TriPSs/conventional-changelog-action/master/src/index.js'
  ]
}

Not bumping the package.json or creating the tag

Hi and thank you very much for the action.
When I run the action with mostly default actions, things are not working as expected, although the logs don't show any error.

The changelog is not updated and the package.json not bumped.
Here is my action file https://github.com/paritytech/substrate-js-utils/blob/master/.github/workflows/bump_version.yml#L36

And the logs show:

Using "[email protected]" as git user.email
Using "5" release count
Using "./react-context/package.json" as version file
Using "version" as version path
Using "" as tag prefix
Using "./react-context/CHANGELOG.md" as output file
Using "" as config file
Skipping empty releases is "enabled"
Skipping the update of the version file is "disabled"
Pull to make sure we have the full git history
/usr/bin/git config user.name Conventional Changelog Action
/usr/bin/git config user.email [email protected]
/usr/bin/git remote set-url origin ***github.com/paritytech/substrate-js-utils.git
/usr/bin/git pull --unshallow --tags --ff-only
From https://github.com/paritytech/substrate-js-utils
 * [new tag]         0.6.0      -> 0.6.0
Already up to date.
Recommended release type: patch
Because: There are 0 BREAKING CHANGES and 0 features
Files to bump: ./react-context/package.json
Bumping version to file "./react-context/package.json" with extension "json"
Changelog generated
## [0.6.1](https://github.com/paritytech/substrate-js-utils/compare/0.6.0...0.6.1) (2020-09-15)




Generated changelog is empty and skip-on-empty has been activated so we skip this step

exclamation mark (!) in commit message instead BREAKING CHANGE missbehavior

Exclamation mark causing wired behavior

Our configuration

this is our step in pipeline:

        steps:
            -   uses: actions/checkout@v2
            -   name: Generate changelog and tag (without writing to file nor committing)
                id: changelog
                uses: TriPSs/conventional-changelog-action@v3
                with:
                    github-token: ${{ secrets.GITHUB_TOKEN }}
                    output-file: 'false'
                    skip-commit: 'true'
                    skip-on-empty: 'false'

            -   name: Create Release
                uses: actions/create-release@v1
                env:
                    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                with:
                    tag_name: ${{ steps.changelog.outputs.tag }}
                    release_name: ${{ steps.changelog.outputs.tag }}
                    body: ${{ steps.changelog.outputs.clean_changelog }}

our commit message is containing an exclamation mark ! and no BREAKING CHANGE in footer

    feat(attribute)!: add attribute-key for attribute references
    
    task #VILO-517

Current Behavior

the action is not crating the change log (it is empty) and the next tag contains is a patch not a major bump

Try to dig into the problem

we tried to add the BREAKING CHANGE into the footer:

    feat(attribute)!: add attribute-key for attribute references
    
    task #VILO-517
    BREAKING CHANGE: mandatory field added

this ends up with an correct bump to major version and we have a changelog, but the format looks like this:



Features

  • attribute: add attribute-key for attribute references (ca21dcc), closes #VILO-517

  • feat!: remove entity property fk prefixes (3463fc5), closes #VILO-493

BREAKING CHANGES

  • attribute: mandatory field added


as you can see the feat!: remove entity property fk prefixes (3463fc5), closes #VILO-493 contains the feat!: part

Expectation

the conventional commits doc is giving this rule:

If included in the type/scope prefix, breaking changes MUST be indicated by a ! immediately before the :. If ! is used, BREAKING CHANGE: MAY be omitted from the footer section, and the commit description SHALL be used to describe the breaking change.

should be ok as commit message

    feat(attribute)!: add attribute-key for attribute references
    
    task VILO-517

Skip creating tag

I use this action for the body that it produces, but I don't use the versioning or other features.
I would love the ability to skip creating the tag itself since it is duplicative (and in my case, the wrong version).

`package-lock.json` won't update

Deliberate duplicate of #8 (closed automatically)

I'm about to rewrite my whole action without changelog because of this. Is there a reason why package-lock.json is not being taken into consideration when bumping version?

I'll gladly work on a patch and submit a PR if I'm given the green light.

Not geting bump in either package.json or package-lock.json

I've been trying to get this to work and I'm probably missing something simple but i can't for the life of me figure it out.

This is my bump.yml

name: Bump version
on:
  push:
    branches:
      - master
    paths-ignore:
      - 'package.json'
      - 'CHANGELOG.md'
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.GITHUB_TOKEN  }}
    - name: Bump version and push tag
      uses: TriPSs/conventional-changelog-action@v3
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        git-message: 'chore(release): {version}'
        preset: 'angular'
        tag-prefix: ''
        output-file: 'CHANGELOG.md'
        version-file: 'package.json, package-lock.json'

And this is my log,

Using "angular" preset
Using "chore(release): {version}" as commit message
Using "Conventional Changelog Action" as git user.name
Using "[email protected]" as git user.email
Using "5" release count
Using "package.json, package-lock.json" as version file
Using "version" as version path
Using "" as tag prefix
Using "CHANGELOG.md" as output file
Using "" as config file
Skipping empty releases is "enabled"
Skipping the update of the version file is "disabled"
Pull to make sure we have the full git history
/usr/bin/git config user.name Conventional Changelog Action
/usr/bin/git config user.email [email protected]
/usr/bin/git remote set-url origin ***github.com/BanJoeH/PANTRI.git
/usr/bin/git rev-parse --is-shallow-repository
true
/usr/bin/git pull --unshallow --tags --ff-only
From https://github.com/BanJoeH/PANTRI
 * [new branch]      gh-pages   -> origin/gh-pages
Already up to date.
Recommended release type: patch
Because: There are 0 BREAKING CHANGES and 0 features
Files to bump: package.json, package-lock.json
Bumping version to file "package.json" with extension "json"
Bumping version to file "package-lock.json" with extension "json"
Bumped file "/home/runner/work/PANTRI/PANTRI/package.json" from "2.1.0" to "2.1.1"
Bumped file "/home/runner/work/PANTRI/PANTRI/package-lock.json" from "2.1.0" to "2.1.1"
Changelog generated
## 2.1.1 (2021-08-20)




Generated changelog is empty and skip-on-empty has been activated so we skip this step

Anyhelp would be greatly apreciated

Getting "You are not currently on a branch." error when running sample release steps

Im trying to get this action to work but I can't figure out the issue here. I'm not changing anything from the sample.

Workflow:

      # Checkout code
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.ref }}
        
      # Create a changelog
      - name: Create Changelog
        id: changelog
        uses: TriPSs/conventional-changelog-action@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN  }}
          
      # Create a release
      - name: Create Release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN  }}
        with:
          tag_name: ${{ steps.changelog.outputs.tag }}
          release_name: ${{ steps.changelog.outputs.tag }}
          body: ${{ steps.changelog.outputs.clean_changelog }}

Error:

You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

(node:2758) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:2758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2758) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

silent error if tag already exists

I think I've found a bug.

when the tag for next version already exists, there is an error, but workflow finished successfull.
Output of step:

#SNIPPET#
New version: 3.25.0
/usr/bin/git add .
/usr/bin/git commit -m chore(release): v3.25.0
[master f96c99e] chore(release): v3.25.0
 2 files changed, 28 insertions(+), 10 deletions(-)
/usr/bin/git tag -a v3.25.0 -m v3.25.0
fatal: tag 'v3.25.0' already exists
(node:2472) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
(node:2472) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:2472) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Action settings

Run TriPSs/conventional-changelog-action@v3
  with:
    github-token: ***
    release-count: 20
    git-message: chore(release): {version}
    git-user-name: Conventional Changelog Action
    git-user-email: [email protected]
    git-pull-method: --ff-only
    preset: angular
    tag-prefix: v
    output-file: CHANGELOG.md
    version-file: ./package.json
    version-path: version
    skip-on-empty: true
    skip-version-file: false
    skip-commit: false
    fallback-version: 0.1.0

Release Count and Format is wrong

Hi, thanks for the Action.

we use it in our workflow. It updates CHANGELOG.md, package.json and creates a new tag. But the format of the Changelog is not what we expect. There is just one release in the changelog.
Also different to the npm cli version, there is no git compare link to the previous tag.

Our workflow config:

      - uses: actions/checkout@master
      - name: Conventional Changelog Action
        uses: TriPSs/[email protected]
        with:
          github-token: ${{ secrets.github_token }}
          git-message: "chore(release): {version}"
          preset: "angular"
          tag-prefix: "v"
          output-file: "CHANGELOG.md"
          changelog-release-count: 10

currrent Changelog.md

$ cat CHANGELOG.md
## 0.0.6 (2020-04-16)


expected Changelog generated with CLI

$ conventional-changelog -p angular -k ./package.json -r 10 -t v
## [0.0.6](https://github.com/REDACTED/compare/v0.0.5...v0.0.6) (2020-04-16)



## [0.0.5](https://github.com/REDACTED/compare/v0.0.4...v0.0.5) (2020-04-15)


### Bug Fixes

* **changelog:** rebuild changelog ([REDACTED](https://github.com/REDACTED/commit/REDACTED))
* **changelog:** use latest stable ([REDACTED](https://github.com/REDACTED/commit/REDACTED))



## [0.0.4](https://github.com/REDACTED/compare/v0.0.3...v0.0.4) (2020-04-15)


### Bug Fixes

* **git:** case-insensitive filesystem ([REDACTED](https://github.com/REDACTED/commit/REDACTED))



## [0.0.3](https://github.com/REDACTED/compare/v0.0.2...v0.0.3) (2020-04-15)


### Bug Fixes

* **pipeline:** only validate when code is correct ([REDACTED](https://github.com/REDACTED/commit/REDACTED))



## [0.0.2](https://github.com/REDACTED/compare/REDACTED...v0.0.2) (2020-04-15)


### Bug Fixes

* **pipeline:** fix module test ([REDACTED](https://github.com/REDACTED/commit/REDACTED))
* **pipeline:** fix typo in ref ([REDACTED](https://github.com/REDACTED/commit/REDACTED))
* **pipeline:** initial version setup ([REDACTED](https://github.com/REDACTED/commit/REDACTED))
* **pipeline:** wait for other jobs before releasing ([REDACTED](https://github.com/REDACTED/commit/REDACTED))
* **s3:** correct transition rule type ([REDACTED](https://github.com/REDACTED/commit/REDACTED))


### Features

* **pipeline:** release version on successfull tests if master branch ([REDACTED](https://github.com/REDACTED/commit/REDACTED))

`skip-on-empty` is true by default

hey @TriPSs, due to the recent PR I did, I noticed I was using v2 instead of v3 so I decided to make the switch. Sadly, my workflow started to fail somehow and I found out that skip-on-empty isn't defaulting to false as per the docs. It all started to come back together again once I explicitly declared skip-on-empty: false on my workflow yaml.

It'd be great if you could take a real quick look at this and let me know if you wish me to patch it, I don't mind doing it, seems a microscopic fix

critical: `conventional-changelog-conventionalcommits` haven't installed in the 3.1.0 release

Issue

There it is for 3.0.0 github.com/TriPSs/conventional-changelog-action/tree/v3.0.0/node_modules

And for 3.1.0 there is not https://github.com/TriPSs/conventional-changelog-action/tree/v3.1.0/node_modules

For some very odd reason when I am using yarn install against master it does add conventional-changelog-conventionalcommits to the node_modules, but if I am using yarn install --prod it does not.

I don't know what the hell it is, and how it is even possible, but it looks like when running release github action against 3.1.0 it run yarn --production and did not add conventional-changelog-conventionalcommits tot the node_modules.

It resulted in my workflow being now completely broken because I am using this action with conventionalcommits preset:

      - name: Changelog
        id: changelog
        uses: TriPSs/conventional-changelog-action@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          git-message: 'chore(release): bump to {version}'
          preset: conventionalcommits
          pre-commit: ci/dist/index.js
          skip-on-empty: false

Solution

Either

  1. Use npm instead of yarn (with npm ci instead of yarn --production it is installing everything)
  2. Use yarn without --production.

refactor type skipped

Hey

it seems like the "refactor"-type is not supported (will be skipped) as commit message.

example:

refactor(test): something important

this refactors something important

-> will be ignored

feat(test): something important

this refactors something important

-> works fine

preset is angular

Is this intended? How can I enable the refactor -type?

Make package.json optional

Hello,

This action looks great!

However, I cannot help but notice that it wants a package.json. I saw we can choose where it is located.

But can we use this action when we don't have a package.json at all? Like for any project which is not based on npm (could be maven, gradle, cargo, elm, you name it)

Error "At least 1 approving review is required by reviewers with write access."

Hi, thanks for this useful tool. Sadly, I came across it after having written most of the code myself, so being able to remove all of it helped ease the burden of my GitHub actions tremendously, it really felt like a breeze, to say the least.

I'm, however, running into the same issue now that I was getting before with my very own code. In my repo, I'm enforcing at least 1 peer-review to each PR before merging, and when this tool bumps the version and tries to commit and push it, I'm getting the following error:

image

Which is indeed due to GitHub not liking direct pushes to master that obviously do not meet the "at least 1 peer-review" criteria.

I got to know this tool thanks to the Medium post at https://medium.com/swlh/bump-bump-bump-d0dab616e83. In there, it says this action took care of the very same issue with peer reviews I'm getting now, and since such situation appears not to be in line with what I'm experiencing, I was left wondering whether the post was right and I'm missing something or the author just did overlook this issue.

So, is there an actual way to work around this?

Thanks in advance guys

arbitrary file extension

We have a usecase where we have valid json file that happen to be named something else (like.uplugin or .uproject). Is it possible to set a flag to tell it to just accept this extension as json?

Version-update not committed (when changelog is not created due to being empty)

Hi there! First off, thanks a bunch for creating this awesome action! 👍 I appreciate the time and effort you put into this as it saves me a lot of time when setting up new projects.

I have just set up a brand new project and included the latest version of your action in my Github workflows. And now -unfortunately- I ran into an issue.

I noticed that my first PR did not generate a version-commit. Now this could be because no changelog was generated (as the PR consists out of chores exclusively), but that is not what I expected after reading the README for this repo.

Could this be a bug, or is this indeed intended? In the latter case I will create a PR to clarify this in the README. Just in case it is a bug, I will add my workflow and action output here:

The configuration:

name: Create Release
on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Bump version & Create changelog
        id: changelog
        uses: TriPSs/conventional-changelog-action@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          preset: 'angular'
          output-file: 'false'

      - name: Create Release
        uses: actions/create-release@v1
        if: ${{ steps.changelog.outputs.skipped == 'false' }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ steps.changelog.outputs.tag }}
          release_name: ${{ steps.changelog.outputs.tag }}
          body: ${{ steps.changelog.outputs.clean_changelog }}
          prerelease: true

And the output:

Run TriPSs/conventional-changelog-action@v3
Using "angular" preset
Using "chore(release): {version}" as commit message
Using "Conventional Changelog Action" as git user.name
Using "[email protected]" as git user.email
Using "5" release count
Using "./package.json" as version file
Using "version" as version path
Using "v" as tag prefix
Using "false" as output file
Using "" as config file
Skipping empty releases is "enabled"
Skipping the update of the version file is "disabled"
Pull to make sure we have the full git history
/usr/bin/git config user.name Conventional Changelog Action
/usr/bin/git config user.email [email protected]
/usr/bin/git remote set-url origin ***github.com/some/nice.git
/usr/bin/git rev-parse --is-shallow-repository
true
/usr/bin/git pull --unshallow --tags --ff-only
From https://github.com/some/nice
 * [new branch]      gh-pages   -> origin/gh-pages
Already up to date.
Recommended release type: patch
Because: There are 0 BREAKING CHANGES and 0 features
Files to bump: ./package.json
Bumping version to file "./package.json" with extension "json"
Bumped file "/home/runner/work/some/nice/package.json" from "0.0.1" to "0.0.2"
Changelog generated
## 0.0.2 (2021-01-28)




Generated changelog is empty and skip-on-empty has been activated so we skip this step

Any help is much appreciated. Please let me know if this needs additional clarification.

"/usr/bin/git' failed with exit code 128"

Action Fails with ~

at maybeClose (internal/child_process.js:1021:16) at Socket.<anonymous> (internal/child_process.js:430:11) at Socket.emit (events.js:210:5) at Pipe.<anonymous> (net.js:659:12) (node:2675) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) Using "angular" preset Using "chore(release): {version}" as commit message Using "Conventional Changelog Action" as git user.name Using "[email protected]" as git user.email Using "5" release count Using "./package.json" as version file Using "version" as version path Using "v" as tag prefix Using "CHANGELOG.md" as output file Using "" as config file Skipping empty releases is "enabled" Skipping the update of the version file is "disabled" Pull to make sure we have the full git history /usr/bin/git config user.name Conventional Changelog Action /usr/bin/git config user.email [email protected] /usr/bin/git remote set-url origin ***github.com/Kimba666/changelogs.git /usr/bin/git pull --unshallow --tags --ff-only fatal: not a git repository (or any of the parent directories): .git fatal: not in a git directory fatal: not in a git directory fatal: not a git repository (or any of the parent directories): .git ##[error]The process '/usr/bin/git' failed with exit code 128

You are not currently on a branch.

Hi,

I'm not sure what I'm doing wrong, I think there's maybe a bug?

My release workflow logs:

You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

(node:1600) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:574:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:557:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v3/node_modules/@actions/exec/lib/toolrunner.js:451:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:1600) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1600) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Messes up TOML file

I tried using this action with a toml file, and I got some weird results when the version got bumped.
(*I do know that this action isn't exactly intended for use with Python, however this has pretty conveniently worked so far, and I personally prefer the versioning offered by this).

What weird results?

Vyvy-vi/botish-api@1620df4

If you look a the file, it added a new version key on top, and it also formatted the contents, in a somewhat weird manner.

(*Since this isn't exactly a use-case aligning with the general direction fo the project, is this something that anyone would be interesting in implementing/merging into the project?)

Determining current version from git skips newly pulled tags

First of all, thanks a lot for the awesome tool!

I came across what looks like a bug when setting this up today. It looks like, even though new tags get pulled before determining the current version from git, the library is ignoring them. In this example, you can see that tags v0.176.0 and v0.177.0 were pulled, but the action calculated the changelog between v0.175.0 (newest tag before the pull) and v0.176.0 (which it bumped to): https://github.com/spinnaker/keel/runs/1818362589?check_suite_focus=true#step:6:64

Here's my setup:

      - name: Prepare changelog
        id: changelog
        uses: TriPSs/conventional-changelog-action@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          output-file: "false"
          skip-version-file: "true"
          skip-commit: "true"

Am I perhaps misconfiguring something? I've tried my best to find similar occurrences in previously closed issues and looked over the code, which looks OK to me, so not sure what could be causing this to happen.

Git pull Warning

There seems to be a new git warning:

Run TriPSs/[email protected]
  with:
    github-token: ***
    release-count: 0
    skip-on-empty: true
    git-message: chore(release): {version}
    preset: angular
    tag-prefix: v
    output-file: CHANGELOG.md
    package-json: ./package.json
Using "angular" preset
Using "chore(release): {version}" as commit message
Using "0" release count
Using "./package.json"
Using "v" as tag prefix
Using "CHANGELOG.md" as output file
Pull to make sure we have the full git history
/usr/bin/git config user.name Conventional Changelog Action
/usr/bin/git remote set-url origin ***github.com/ORG/REPO.git
/usr/bin/git config user.email [email protected]
/usr/bin/git checkout master
/usr/bin/git pull --unshallow
Already on 'master'
Your branch is up to date with 'origin/master'.
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

Already up to date.
Recommended release type: minor
because: There are 0 BREAKING CHANGES and 41 features
Changelog generated
# 0.45.0 (2020-06-11)

A fix could be to add --ff-only to the pull command https://github.com/TriPSs/conventional-changelog-action/blob/master/src/helpers/git.js#L93

Generate Changelog ONLY - no tags, no commits

Hey guys, I'm loving this action, keep the good work! Hopefully I'm able to collaborate at some point :)

I was wondering if there's a way to generate a changelog only, that doesn't generate any commits or tags.
In our process we might need a way to generate a changelogs that includes changes from version X to version Y, including all the commits in that range. Would that be possible with the current implementation?

pre-release

Hi,

Is it possible to have pre-release channels with this utility?

Let's say that I want to publish stable releases for each commit on by main branch, while publishing beta releases for each commit in a beta branch.

Is that possible?

Question: Jira Compatability

What Jira functionalities does this action support?

What I'm trying to do is have the commit message contain the Jira Issue Key for the related jira task, as a clickable link that will take the user to the corresponding Jira task.

An example commit would be something like~ "git commit -m 'fix: addressed a bug on the dashboard [JIRA-123]'

And then in the actual Commit Message within the Changelog.md created from the action, the "[JIRA-123]" would be a hyperlink to the jira task that is related to that changelog entry.

Is this possible with this action?

no such file or directory when looking for package.json

In my project, the package.json file is in a subfolder and not at the root folder.

This causes the action to fail silently with the following message,

(node:4861) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/home/runner/work/project-name/project-name/package.json'
    at Object.openSync (fs.js:440:3)
    at Object.readFileSync (fs.js:342:35)
    at Object.get (/home/runner/work/_actions/TriPSs/conventional-changelog-action/v2.0.1/src/helpers/packageJson.js:13:26)
    at /home/runner/work/_actions/TriPSs/conventional-changelog-action/v2.0.1/src/index.js:27:23

It would be helpful if there is a possibility to either,

  1. set the root folder of the project
  2. set a path to the package.json file (similar to output-file)

Provide custom tag instead of bumping automatically from file

Hello,

We are quite happy with your action, but would like to provide custom tags lower than current version to the action inputs. In our case we have two different versions for staging and prod and this is what we use to deploy hotfix on prod. Are you open for PR for this feature?

github-token clarification…

I have a protected main branch with admins allowed to push and a private token from an admin account set as github-token: ${{ secrets.ADMIN_RELEASE_TOKEN }}. However, when running the action, I get:

remote: error: GH006: Protected branch update failed for refs/heads/main.       
remote: error: At least 1 approving review is required by reviewers with write access.

The token I use has delete:packages, repo, write:packages permissions. Should it have more or did I find a bug?

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.