Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only last commit made has effect on verison bump and written to changelog #16

Closed
b12k opened this issue Feb 9, 2021 · 5 comments
Closed

Comments

@b12k
Copy link

b12k commented Feb 9, 2021

Hello.
In my release-it + @release-it/conventional-changelog setup only last commit made is affecting version bump and written to the changelog.
Also only last commit is taken in to consideration when bumping a version.
So if:

  • v0.1.0
  • commit feat
  • commit fix <= this one used
  • v0.1.1 (not v0.2.0)

Example repo: https://github.com/b12k/gh-action-release-it

This repo uses github action to do an automated release on PR merge to master (using rebase).

I would appreciate some advice on why it may happen.

Thanx in advance.

UPDATE:

Here is git log
  commit af26c4a5effc9caa01d6110741e991e83bdeb0f5 (HEAD -> master, origin/master)
  Author: ci <ci@b12k.com>
  Date:   Wed Feb 10 12:33:08 2021 +0000
  
      ci: release 0.1.2
  
  commit 9fc3e73f36beca6dc351e9bee40cb6f6792e96a7
  Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
  Date:   Wed Feb 10 13:31:56 2021 +0100
  
      fix: dummy fix commit
  
  commit 6714424d45175ef420f39e82f88e611489a61fbc
  Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
  Date:   Wed Feb 10 13:31:35 2021 +0100
  
      feat: enable debug mode
  
  commit f07d4f5984f1d3388f6fff687bd1a86beb2878f1
  Author: ci <ci@b12k.com>
  Date:   Wed Feb 10 12:19:26 2021 +0000
  
      ci: release 0.1.1
  
  commit 560aa843694f8ec3e23c9194a55203c69e8c55cf
  Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
  Date:   Wed Feb 10 13:18:23 2021 +0100
  
      fix: fix 1
  
  commit daddac8be0da536e1b1ce4ccd170392fb76cf3cf
  Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
  Date:   Wed Feb 10 13:17:55 2021 +0100
  
      feat: feat 2
  
  commit 48a71f8e81c23ba3efce6fe39cf07a2801221a82
  Author: ci <ci@b12k.com>
  Date:   Wed Feb 10 11:32:27 2021 +0000
  
      ci: release 0.1.0
  
  commit 39f3e39a71b456e206674bc1ad2b17682ec42fef
  Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
  Date:   Wed Feb 10 12:31:24 2021 +0100
  
      feat: feat 1
  
  commit df1d2d0457145a4ca79832259c51d4ca6026332c
  Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
  Date:   Wed Feb 10 12:29:55 2021 +0100
  
      initial
Debug
  > release-it-exp@0.1.1 release /home/runner/work/gh-action-release-it/gh-action-release-it
  > DEBUG=release-it:* release-it --git.requireBranch=master
  
  2021-02-10T12:33:07.678Z release-it:config {
    cosmiconfig: {
      config: {
        plugins: [Object],
        git: [Object],
        npm: [Object],
        github: [Object]
      },
      filepath: '/home/runner/work/gh-action-release-it/gh-action-release-it/package.json'
    }
  }
  2021-02-10T12:33:07.682Z release-it:config {
    system: { 'release-it': '14.3.0', node: 'v12.20.1', os: 'Linux 5.4' }
  }
  2021-02-10T12:33:07.682Z release-it:config {
    _: [],
    git: {
      requireBranch: 'master',
      push: true,
      commitMessage: 'ci: release ${version}',
      pushArgs: [ '--follow-tags' ],
      changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
      requireCleanWorkingDir: true,
      requireUpstream: true,
      requireCommits: false,
      addUntrackedFiles: false,
      commit: true,
      commitArgs: [],
      tag: true,
      tagName: null,
      tagAnnotation: 'Release ${version}',
      tagArgs: [],
      pushRepo: ''
    },
    increment: undefined,
    ci: true,
    plugins: {
      '@release-it/conventional-changelog': { infile: 'CHANGELOG.md', preset: [Object] }
    },
    npm: {
      publish: false,
      publishPath: '.',
      tag: null,
      otp: null,
      ignoreVersion: false,
      skipChecks: false,
      timeout: 10
    },
    github: {
      release: true,
      releaseName: 'Release ${version}',
      releaseNotes: null,
      preRelease: false,
      draft: false,
      tokenRef: 'GITHUB_TOKEN',
      assets: null,
      host: null,
      timeout: 0,
      proxy: null,
      skipChecks: false
    },
    hooks: {},
    gitlab: {
      release: false,
      releaseName: 'Release ${version}',
      releaseNotes: null,
      tokenRef: 'GITLAB_TOKEN',
      assets: null,
      origin: null,
      skipChecks: false
    },
    isUpdate: false,
    version: {
      increment: undefined,
      isPreRelease: false,
      preReleaseId: undefined
    }
  }
  2021-02-10T12:33:07.846Z release-it:config {
    'conventional-changelog': {
      infile: 'CHANGELOG.md',
      preset: { name: 'angular', types: [Array] }
    }
  }
  2021-02-10T12:33:07.847Z release-it:plugins {
    namespace: 'conventional-changelog',
    options: {
      infile: 'CHANGELOG.md',
      preset: { name: 'angular', types: [Array] },
      tagName: null
    }
  }
  2021-02-10T12:33:07.857Z release-it:plugins {
    namespace: 'npm',
    options: {
      publish: false,
      publishPath: '.',
      tag: null,
      otp: null,
      ignoreVersion: false,
      skipChecks: false,
      timeout: 10
    }
  }
  2021-02-10T12:33:07.859Z release-it:plugins {
    namespace: 'github',
    options: {
      release: true,
      releaseName: 'Release ${version}',
      releaseNotes: null,
      preRelease: false,
      draft: false,
      tokenRef: 'GITHUB_TOKEN',
      assets: null,
      host: null,
      timeout: 0,
      proxy: null,
      skipChecks: false,
      tagName: null,
      pushRepo: '',
      changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
      isUpdate: false
    }
  }
  2021-02-10T12:33:07.863Z release-it:plugins {
    namespace: 'git',
    options: {
      requireBranch: 'master',
      push: true,
      commitMessage: 'ci: release ${version}',
      pushArgs: [ '--follow-tags' ],
      changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
      requireCleanWorkingDir: true,
      requireUpstream: true,
      requireCommits: false,
      addUntrackedFiles: false,
      commit: true,
      commitArgs: [],
      tag: true,
    repo: 'gh-action-release-it',
    tag_name: '0.1.2',
    name: 'Release 0.1.2',
    body: '## 0.1.2 (2021-02-10)\n' +
      '\n' +
      '\n' +
      '### Bug Fixes\n' +
      '\n' +
      '* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))',
    draft: false,
    prerelease: false
  }
  POST /repos/b12k/gh-action-release-it/releases - 201 in 407ms
  2021-02-10T12:33:12.044Z release-it:github {
    url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/37858104',
    assets_url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/37858104/assets',
    upload_url: 'https://uploads.github.com/repos/b12k/gh-action-release-it/releases/37858104/assets{?name,label}',
    html_url: 'https://github.com/b12k/gh-action-release-it/releases/tag/0.1.2',
    id: 37858104,
    author: {
      login: 'b12k',
      id: 10243265,
      node_id: 'MDQ6VXNlcjEwMjQzMjY1',
      avatar_url: 'https://avatars.githubusercontent.com/u/10243265?v=4',
      gravatar_id: '',
      url: 'https://api.github.com/users/b12k',
      html_url: 'https://github.com/b12k',
      followers_url: 'https://api.github.com/users/b12k/followers',
      following_url: 'https://api.github.com/users/b12k/following{/other_user}',
      gists_url: 'https://api.github.com/users/b12k/gists{/gist_id}',
      starred_url: 'https://api.github.com/users/b12k/starred{/owner}{/repo}',
      subscriptions_url: 'https://api.github.com/users/b12k/subscriptions',
      organizations_url: 'https://api.github.com/users/b12k/orgs',
      repos_url: 'https://api.github.com/users/b12k/repos',
      events_url: 'https://api.github.com/users/b12k/events{/privacy}',
      received_events_url: 'https://api.github.com/users/b12k/received_events',
      type: 'User',
      site_admin: false
    },
    node_id: 'MDc6UmVsZWFzZTM3ODU4MTA0',
    tag_name: '0.1.2',
    target_commitish: 'master',
    name: 'Release 0.1.2',
    draft: false,
    prerelease: false,
    created_at: '2021-02-10T12:33:08Z',
    published_at: '2021-02-10T12:33:11Z',
    assets: [],
    tarball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/tarball/0.1.2',
    zipball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/zipball/0.1.2',
    body: '## 0.1.2 (2021-02-10)\n' +
      '\n' +
      '\n' +
      '### Bug Fixes\n' +
      '\n' +
      '* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))'
  }
  🔗 https://github.com/b12k/gh-action-release-it/releases/tag/0.1.2
  2021-02-10T12:33:12.090Z release-it:metrics {
  🏁 Done (in 4s.)
    url: 'http://www.google-analytics.com/collect',
    statusCode: 200,
    statusMessage: 'OK',
    payload: 't=event&ec=session&ea=end'
  }
@b12k b12k changed the title Only last commit is written to changelog Only last commit made has effect on verison bump and written to changelog Feb 10, 2021
@webpro
Copy link
Contributor

webpro commented Feb 22, 2021

Not sure about the issue here. The options for the plugin are passed verbatim to the conventional-recommended-bump function.

I have just updated the dependencies and added more debug output in v2.0.1 of this plugin. However, I'm surprised not to see debug output from this plugin at all in your output. Can you please update release-it and this plugin, and run this to see what's going on, in what order:

DEBUG_DEPTH=null DEBUG=release-it:* release-it [...]

In your example repo I get this (after going back one commit), which seems correct:

release-it:conventional-changelog {
  release-it:conventional-changelog   increment: undefined,
  release-it:conventional-changelog   latestVersion: '0.1.1',
  release-it:conventional-changelog   isPreRelease: false,
  release-it:conventional-changelog   preReleaseId: undefined
  release-it:conventional-changelog } +0ms
  release-it:conventional-changelog conventionalRecommendedBump {
  options: {
    infile: 'CHANGELOG.md',
    preset: { name: 'angular', types: [Array] },
    tagName: null
  }
} +0ms
  release-it:conventional-changelog {
  release-it:conventional-changelog   err: null,
  release-it:conventional-changelog   result: {
  release-it:conventional-changelog     level: 1,
  release-it:conventional-changelog     reason: 'There are 0 BREAKING CHANGES and 1 features',
  release-it:conventional-changelog     releaseType: 'minor'
  release-it:conventional-changelog   }
  release-it:conventional-changelog } +50ms
  release-it:conventional-changelog conventionalChangelog {
  options: {
    infile: 'CHANGELOG.md',
    preset: { name: 'angular', types: [Array] },
    tagName: null
  },
  context: { version: '0.2.0', previousTag: '0.1.1', currentTag: '0.2.0' },
  gitRawCommitsOpts: {
    debug: [Function: debug] {
      namespace: 'release-it:conventional-changelog',
      useColors: true,
      color: 32,
      extend: [Function: extend],
      destroy: [Function: deprecated],
      enabled: [Getter/Setter],
      inspectOpts: [Object],
      diff: 1,
      prev: 1614029374251,
      curr: 1614029374252
    }
  }
} +1ms
  release-it:conventional-changelog Your git-log command is:
  release-it:conventional-changelog git log --format=%B%n-hash-%n%H%n-gitTags-%nNaN%n-committerDate-%n%ci%n------------------------ >8 ------------------------ 0.1.1 --no-merges
  release-it:conventional-changelog Your git-log command is:
  release-it:conventional-changelog git log --format=%B%n-hash-%n%H%n-gitTags-%nNaN%n-committerDate-%n%ci%n------------------------ >8 ------------------------ 0.1.1..HEAD --no-merges
  release-it:config {
  release-it:config   name: 'release-it-exp',
  release-it:config   latestVersion: '0.1.1',
  release-it:config   version: undefined,
  release-it:config   changelog: '# [0.2.0](https://github.com/b12k/gh-action-release-it/compare/0.1.1...0.2.0) (2021-02-22)\n' +
  release-it:config     '\n' +
  release-it:config     '\n' +
  release-it:config     '### Bug Fixes\n' +
  release-it:config     '\n' +
  release-it:config     '* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))\n' +
  release-it:config     '\n' +
  release-it:config     '\n' +
  release-it:config     '### Features\n' +
  release-it:config     '\n' +
  release-it:config     '* enable debug mode ([6714424](https://github.com/b12k/gh-action-release-it/commit/6714424d45175ef420f39e82f88e611489a61fbc))'
  release-it:config } +268ms

@b12k
Copy link
Author

b12k commented Feb 24, 2021

@webpro I did an update of the repos dependencies. Also invited you as collaborator.
Created 2 commits and did a release in respective order.

feat: feat #3, next fix #3 so after release 0.2.0 => 0.3.0
fix: fix #3, prev was feat #3 so after release 0.2.0 => 0.3.0, but 0.2.1

Git log
commit 94c2d9e95b74c8a7bc7bf37c664e46aa62678b49 (HEAD -> master, tag: 0.2.1, origin/master, origin/HEAD)
Author: ci <ci@b12k.com>
Date:   Wed Feb 24 16:48:29 2021 +0000

    ci: release 0.2.1

commit 6fdb47494b2552a0b800990324771c971b01ecdf
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 24 17:47:06 2021 +0100

    fix: fix #3, prev was feat #3 so after release 0.2.0 => 0.3.0, but 0.2.1

commit 473063a5e79798f4a1a06e590d637745b5ce52fc
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 24 17:45:58 2021 +0100

    feat: feat #3, next fix #3 so after release 0.2.0 => 0.3.0

commit 8fb52b13767582506edc089192151bf8afd1adc1 (tag: 0.2.0)
Author: ci <ci@b12k.com>
Date:   Wed Feb 24 16:42:31 2021 +0000

    ci: release 0.2.0

commit 695ef3a96d36132c348a9a4579db3b01fafd89dd
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 24 17:41:27 2021 +0100

    feat: more debug

commit d35b2541f7165f6f6a91fecfdec010be6ee1bf75 (tag: 0.1.4)
Author: ci <ci@b12k.com>
Date:   Wed Feb 24 16:38:37 2021 +0000

    ci: release 0.1.4

commit b736e809fbc5549ffca42a6367cdc2e843b4655d
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 24 17:37:27 2021 +0100

    fix: change to conventionalcommits

commit 984f064a295aad51ecf0f824464f314077ec21a3 (tag: 0.1.3)
Author: ci <ci@b12k.com>
Date:   Wed Feb 24 16:34:27 2021 +0000

    ci: release 0.1.3

commit 665078d3594907aedd242ea0a6497b4aa7e68c5f
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 24 17:32:53 2021 +0100

    build: dependencies update

commit af26c4a5effc9caa01d6110741e991e83bdeb0f5 (tag: 0.1.2)
Author: ci <ci@b12k.com>
Date:   Wed Feb 10 12:33:08 2021 +0000

    ci: release 0.1.2

commit 9fc3e73f36beca6dc351e9bee40cb6f6792e96a7
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 10 13:31:56 2021 +0100

    fix: dummy fix commit

commit 6714424d45175ef420f39e82f88e611489a61fbc
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 10 13:31:35 2021 +0100

    feat: enable debug mode

commit f07d4f5984f1d3388f6fff687bd1a86beb2878f1 (tag: 0.1.1)
Author: ci <ci@b12k.com>
Date:   Wed Feb 10 12:19:26 2021 +0000

    ci: release 0.1.1

commit 560aa843694f8ec3e23c9194a55203c69e8c55cf
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 10 13:18:23 2021 +0100

    fix: fix 1

commit daddac8be0da536e1b1ce4ccd170392fb76cf3cf
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 10 13:17:55 2021 +0100

    feat: feat 2

commit 48a71f8e81c23ba3efce6fe39cf07a2801221a82 (tag: 0.1.0)
Author: ci <ci@b12k.com>
Date:   Wed Feb 10 11:32:27 2021 +0000

    ci: release 0.1.0

commit 39f3e39a71b456e206674bc1ad2b17682ec42fef
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 10 12:31:24 2021 +0100

    feat: feat 1

commit df1d2d0457145a4ca79832259c51d4ca6026332c
Author: Bogdan Kolesnyk <bogdan.kolesnyk@gmail.com>
Date:   Wed Feb 10 12:29:55 2021 +0100

    initial
Debug
> release-it-exp@0.2.0 release /home/runner/work/gh-action-release-it/gh-action-release-it
> DEBUG_DEPTH=null DEBUG=release-it:* release-it --git.requireBranch=master

2021-02-24T16:48:28.044Z release-it:config {
  cosmiconfig: {
    config: {
      plugins: {
        '@release-it/conventional-changelog': {
          infile: 'CHANGELOG.md',
          preset: {
            name: 'conventionalcommits',
            types: [
              { type: 'feat', section: 'Features' },
              { type: 'fix', section: 'Bug Fixes' },
              { type: 'docs', section: 'Documentation' },
              { type: 'style', section: 'Styles' },
              { type: 'refactor', section: 'Refactoring' },
              { type: 'perf', section: 'Performance' },
              { type: 'test', section: 'Tests' },
              { type: 'build', section: 'Build System' },
              { type: 'ci', hidden: true },
              { type: 'chore', section: 'Miscellaneous Chores' },
              { type: 'revert', section: 'Reverted' }
            ]
          }
        }
      },
      git: {
        push: true,
        commitMessage: 'ci: release ${version}',
        pushArgs: [ '--follow-tags' ]
      },
      npm: { publish: false },
      github: { release: true }
    },
    filepath: '/home/runner/work/gh-action-release-it/gh-action-release-it/package.json'
  }
}
2021-02-24T16:48:28.047Z release-it:config {
  system: { 'release-it': '14.4.1', node: 'v12.20.2', os: 'Linux 5.4' }
}
2021-02-24T16:48:28.047Z release-it:config {
  stderr: ''
}
2021-02-24T16:48:28.627Z release-it:config {
  repo: {
    host: 'github.com',
    owner: 'b12k',
    project: 'gh-action-release-it',
    protocol: 'https',
    remote: 'https://github.com/b12k/gh-action-release-it',
    repository: 'b12k/gh-action-release-it'
  }
}
2021-02-24T16:48:28.630Z release-it:config { latestTag: null }
2021-02-24T16:48:28.631Z release-it:conventional-changelog {
  increment: undefined,
  latestVersion: '0.2.0',
  isPreRelease: false,
  preReleaseId: undefined
}
2021-02-24T16:48:28.631Z release-it:conventional-changelog conventionalRecommendedBump {
  options: {
    infile: 'CHANGELOG.md',
    preset: { name: 'conventionalcommits', types: [Array] },
    tagName: null
  }
}
2021-02-24T16:48:28.667Z release-it:conventional-changelog {
  err: null,
  result: {
    level: 2,
    reason: 'There are 0 BREAKING CHANGES and 0 features',
    releaseType: 'patch'
  }
}
2021-02-24T16:48:28.669Z release-it:conventional-changelog conventionalChangelog {
  options: {
    infile: 'CHANGELOG.md',
    preset: {
      name: 'conventionalcommits',
      types: [Array],
      issuePrefixes: [Array],
      issueUrlFormat: '{{host}}/{{owner}}/{{repository}}/issues/{{id}}',
      commitUrlFormat: '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}',
      compareUrlFormat: '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}',
      userUrlFormat: '{{host}}/{{user}}'
    },
    tagName: null
  },
  context: { version: '0.2.1', previousTag: null, currentTag: '0.2.1' },
  gitRawCommitsOpts: {
    debug: [Function: debug] {
      namespace: 'release-it:conventional-changelog',
      useColors: false,
      color: 3,
      extend: [Function: extend],
      destroy: [Function: deprecated],
      enabled: [Getter/Setter],
      inspectOpts: [Object],
      diff: 2,
      prev: 1614185308667,
      curr: 1614185308669
    }
  }
}
2021-02-24T16:48:28.769Z release-it:conventional-changelog Your git-log command is:
git log --format=%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci%n------------------------ >8 ------------------------ HEAD --no-merges
2021-02-24T16:48:28.839Z release-it:config {
  name: 'release-it-exp',
🚀 Let's release release-it-exp (currently at 0.2.0)
  latestVersion: '0.2.0',
Changelog:
  version: undefined,
### 0.2.1 (2021-02-24)
  changelog: '### 0.2.1 (2021-02-24)\n' +

    '\n' +
### Bug Fixes
    '\n' +
* fix [#3](https://github.com/b12k/gh-action-release-it/issues/3), prev was feat [#3](https://github.com/b12k/gh-action-release-it/issues/3) so after release 0.2.0 => 0.3.0, but 0.2.1 ([6fdb474](https://github.com/b12k/gh-action-release-it/commit/6fdb47494b2552a0b800990324771c971b01ecdf))
    '### Bug Fixes\n' +
    '\n' +
    '* fix [#3](https://github.com/b12k/gh-action-release-it/issues/3), prev was feat [#3](https://github.com/b12k/gh-action-release-it/issues/3) so after release 0.2.0 => 0.3.0, but 0.2.1 ([6fdb474](https://github.com/b12k/gh-action-release-it/commit/6fdb47494b2552a0b800990324771c971b01ecdf))'
}
2021-02-24T16:48:28.840Z release-it:config { version: '0.2.1', isPreRelease: false, preReleaseId: null }
v0.2.1
2021-02-24T16:48:29.124Z release-it:shell {
  command: 'npm version 0.2.1 --no-git-tag-version',
  options: {},
  code: 0,
  stdout: 'v0.2.1',
  stderr: ''
}
2021-02-24T16:48:29.125Z release-it:config { tagName: '0.2.1' }
2021-02-24T16:48:29.126Z release-it:config { tagName: '0.2.1' }
 M CHANGELOG.md
 M package-lock.json
 M package.json
Changeset:
M CHANGELOG.md
 M package-lock.json
 M package.json
2021-02-24T16:48:29.145Z release-it:shell {
  command: 'git status --short --untracked-files=no',
  options: { write: false },
  code: 0,
  stdout: 'M CHANGELOG.md\n M package-lock.json\n M package.json',
  stderr: ''
}
2021-02-24T16:48:29.165Z release-it:shell {
  command: [ 'git', 'add', '.', '--update' ],
  options: {},
  stdout: '',
  stderr: ''
}
2021-02-24T16:48:29.185Z release-it:shell {
  command: [ 'git', 'commit', '--message', 'ci: release 0.2.1' ],
  options: {},
  stdout: '[master 94c2d9e] ci: release 0.2.1\n' +
    ' 3 files changed, 9 insertions(+), 2 deletions(-)',
  stderr: ''
}
2021-02-24T16:48:29.195Z release-it:shell {
  command: [ 'git', 'tag', '--annotate', '--message', 'Release 0.2.1', '0.2.1' ],
  options: {},
  stdout: '',
  stderr: ''
}
2021-02-24T16:48:31.513Z release-it:shell {
  command: [ 'git', 'push', '--follow-tags' ],
  options: {},
  stdout: '',
  stderr: 'To https://github.com/b12k/gh-action-release-it\n' +
    '   6fdb474..94c2d9e  master -> master\n' +
    ' * [new tag]         0.2.1 -> 0.2.1'
}
2021-02-24T16:48:31.516Z release-it:github {
  owner: 'b12k',
  repo: 'gh-action-release-it',
  tag_name: '0.2.1',
  name: 'Release 0.2.1',
  body: '### 0.2.1 (2021-02-24)\n' +
    '\n' +
    '\n' +
    '### Bug Fixes\n' +
    '\n' +
    '* fix [#3](https://github.com/b12k/gh-action-release-it/issues/3), prev was feat [#3](https://github.com/b12k/gh-action-release-it/issues/3) so after release 0.2.0 => 0.3.0, but 0.2.1 ([6fdb474](https://github.com/b12k/gh-action-release-it/commit/6fdb47494b2552a0b800990324771c971b01ecdf))',
  draft: false,
  prerelease: false
}
request {
  method: 'POST',
  baseUrl: 'https://api.github.com',
  headers: {
    accept: 'application/vnd.github.v3+json',
    'user-agent': 'release-it/14.4.1 octokit-rest.js/18.2.0 octokit-core.js/3.2.5 Node.js/12.20.2 (linux; x64)'
  },
  mediaType: { format: '', previews: [] },
  request: { timeout: 0, hook: [Function: bound bound register] },
  url: '/repos/{owner}/{repo}/releases',
  owner: 'b12k',
  repo: 'gh-action-release-it',
  tag_name: '0.2.1',
  name: 'Release 0.2.1',
  body: '### 0.2.1 (2021-02-24)\n' +
    '\n' +
    '\n' +
    '### Bug Fixes\n' +
    '\n' +
    '* fix [#3](https://github.com/b12k/gh-action-release-it/issues/3), prev was feat [#3](https://github.com/b12k/gh-action-release-it/issues/3) so after release 0.2.0 => 0.3.0, but 0.2.1 ([6fdb474](https://github.com/b12k/gh-action-release-it/commit/6fdb47494b2552a0b800990324771c971b01ecdf))',
  draft: false,
  prerelease: false
}
POST /repos/b12k/gh-action-release-it/releases - 201 in 206ms
2021-02-24T16:48:31.735Z release-it:github {
  url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/38665827',
  assets_url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/38665827/assets',
  upload_url: 'https://uploads.github.com/repos/b12k/gh-action-release-it/releases/38665827/assets{?name,label}',
  html_url: 'https://github.com/b12k/gh-action-release-it/releases/tag/0.2.1',
  id: 38665827,
  author: {
    login: 'b12k',
    id: 10243265,
    node_id: 'MDQ6VXNlcjEwMjQzMjY1',
    avatar_url: 'https://avatars.githubusercontent.com/u/10243265?v=4',
    gravatar_id: '',
    url: 'https://api.github.com/users/b12k',
    html_url: 'https://github.com/b12k',
    followers_url: 'https://api.github.com/users/b12k/followers',
    following_url: 'https://api.github.com/users/b12k/following{/other_user}',
    gists_url: 'https://api.github.com/users/b12k/gists{/gist_id}',
    starred_url: 'https://api.github.com/users/b12k/starred{/owner}{/repo}',
    subscriptions_url: 'https://api.github.com/users/b12k/subscriptions',
    organizations_url: 'https://api.github.com/users/b12k/orgs',
    repos_url: 'https://api.github.com/users/b12k/repos',
    events_url: 'https://api.github.com/users/b12k/events{/privacy}',
    received_events_url: 'https://api.github.com/users/b12k/received_events',
    type: 'User',
    site_admin: false
  },
  node_id: 'MDc6UmVsZWFzZTM4NjY1ODI3',
  tag_name: '0.2.1',
  target_commitish: 'master',
  name: 'Release 0.2.1',
  draft: false,
  prerelease: false,
  created_at: '2021-02-24T16:48:29Z',
  published_at: '2021-02-24T16:48:31Z',
  assets: [],
  tarball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/tarball/0.2.1',
  zipball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/zipball/0.2.1',
  body: '### 0.2.1 (2021-02-24)\n' +
    '\n' +
    '\n' +
    '### Bug Fixes\n' +
    '\n' +
    '* fix [#3](https://github.com/b12k/gh-action-release-it/issues/3), prev was feat [#3](https://github.com/b12k/gh-action-release-it/issues/3) so after release 0.2.0 => 0.3.0, but 0.2.1 ([6fdb474](https://github.com/b12k/gh-action-release-it/commit/6fdb47494b2552a0b800990324771c971b01ecdf))'
}
🔗 https://github.com/b12k/gh-action-release-it/releases/tag/0.2.1
2021-02-24T16:48:31.758Z release-it:metrics {
🏁 Done (in 4s.)
  url: 'http://www.google-analytics.com/collect',
  statusCode: 200,
  statusMessage: 'OK',
  payload: 't=event&ec=session&ea=end'
}

You can try doing multiple commits of different types and see that only last commit is written to changelog and influences version bump.

@b12k
Copy link
Author

b12k commented Feb 24, 2021

I found a problem.
It's not in release-it or its plugins.

When creating CI with Github Actions using actions/checkout@v2 do not forget to explicitly set fetch-depth: 0. It is 1 by default. So it means that ONLY last commit made will be fetched.

[...]
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0 <= THIS HELPS =)
[...]

Thank you @webpro for an awesome tool!

@webpro
Copy link
Contributor

webpro commented Feb 24, 2021

Thanks @b12k! Glad you figured it out. I've added a comment to the docs on both this plugin and release-it itself.

@fbonander
Copy link

@b12k Thanks, wouldn't have found that in a million years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants