release-it icon indicating copy to clipboard operation
release-it copied to clipboard

Github release changelog contains only last commit

Open placzkowskim opened this issue 1 year ago • 7 comments

Hi, I've created Github Action that looks like :

name: Relase-it
on:
  workflow_dispatch:
    inputs:
      releaseversion:
        description: "pass release version in v*.*.* format"
        required: true
        type: string

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Install dependencies
        run: npm ci
      - name: End message
        run: echo 'Dependencies installed'
      - name: Initialize Git User
        run: |
          git config --global user.email "[email protected]"
          git config --global user.name "Release Workflow"
      - name: Run release
        run: npx release-it ${{github.event.inputs.releaseversion}} --ci
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

So I'm manually passing version number from workflow input. My commits looks like this: image_2024-01-18_142412195 So as you can see I have two commits between tags v5.0.3 and v5.0.4 hovewer in Github release notes I only have last commit in changelog : image_2024-01-18_142551403 Is there some configuration that I'm missing ? My .releaserc.json looks like :

{
  "git": {
    "requireBranch": "main",
    "commitMessage": "release ${version}"
  },
  "github": {
    "release": true
  },
  "npm": {
    "publish": false
  }

}

As far as I found in documentation it should output all commits between previous and current tag.

placzkowskim avatar Jan 18 '24 13:01 placzkowskim

Please see https://github.com/release-it/release-it?tab=readme-ov-file#troubleshooting--debugging and use verbose and debugging options to better see what's going on.

webpro avatar Jan 18 '24 14:01 webpro

@webpro Ok, I've removed all the tags from my repo and started again, here is the output from scenario:

  1. run Action that creates release - v6.0.0
  2. push 3 commits,
  3. run action that creates release v6.0.1
Run npx release-it v[6](https://github.com/placzkowskim/xx).0.1 --ci  -VV
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD
main
$ git config --get branch.main.remote
origin
$ git remote get-url origin
https://github.com/xx
$ git fetch
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git describe --tags --match=* --abbrev=0
fatal: No names found, cannot describe anything.
$ git symbolic-ref HEAD
refs/heads/main
$ git for-each-ref --format="%(upstream:short)" refs/heads/main
origin/main
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git config --get branch.main.remote  [cached]
$ git remote get-url origin  [cached]
$ git fetch  [cached]
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git describe --tags --match=* --abbrev=0  [cached]
$ git log --pretty=format:"* %s (%h)"
* Commit message test 3. (d[7](https://github.com/xx)
🚀 Let's release realase-test (6.0.0...v6.0.1)
Changelog:
* Commit message test 3. (d7453a7)
$ npm version v6.0.1 --no-git-tag-version
v6.0.1
$ git status --short --untracked-files=no
 M package-lock.json
 M package.json
Changeset:
 M package-lock.json
 M package.json
$ git add . --update

$ git commit --message release v6.0.1
[main 24103[9](https://github.com/xx] release v6.0.1
 2 files changed, 3 insertions(+), 3 deletions(-)
$ git tag --annotate --message Release v6.0.1 v6.0.1

$ git symbolic-ref HEAD  [cached]
$ git for-each-ref --format="%(upstream:short)" refs/heads/main  [cached]
$ git push --follow-tags

! octokit repos.createRelease "Release v6.0.1" (v6.0.1)
octokit repos.createRelease: done (https://api.github.com/repos/xx)
🔗 https://github.com/xx
🏁 Done (in 2s.)

It looks like there are no tags ?? In github I can see those two, as well as in my SourceTree, I dont know what is going on now :/ Zrzut ekranu 2024-01-18 201613 tags

placzkowskim avatar Jan 18 '24 19:01 placzkowskim

may set checkout deep = 0?

northword avatar Jan 23 '24 14:01 northword

Yes, you need to set the workflow checkout job fetch-depth: 0

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

juancarlosjr97 avatar Feb 10 '24 19:02 juancarlosjr97

I've already tried this and still output is the same. Here is updated action code :

name: Relase-it
on:
  workflow_dispatch:
    inputs:
      releaseversion:
        description: "pass release version in v*.*.* format"
        required: true
        type: string

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-dept: 0
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 20.8.1
      - name: Install dependencies
        run: npm ci
      - name: End message
        run: echo 'Dependencies installed'
      - name: Initialize Git User
        run: |
          git config --global user.email "[email protected]"
          git config --global user.name "Release Workflow"
      - name: Run release
        run: npx release-it ${{github.event.inputs.releaseversion}} --ci  -VV
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

placzkowskim avatar Mar 08 '24 14:03 placzkowskim

Yes, I'm having this problem too, the default configuration will only output the latest commit message https://github.com/lvzhenbo/115-plus

lvzhenbo avatar Jul 09 '24 00:07 lvzhenbo

I've already tried this and still output is the same. Here is updated action code :

name: Relase-it
on:
  workflow_dispatch:
    inputs:
      releaseversion:
        description: "pass release version in v*.*.* format"
        required: true
        type: string

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-dept: 0
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 20.8.1
      - name: Install dependencies
        run: npm ci
      - name: End message
        run: echo 'Dependencies installed'
      - name: Initialize Git User
        run: |
          git config --global user.email "[email protected]"
          git config --global user.name "Release Workflow"
      - name: Run release
        run: npx release-it ${{github.event.inputs.releaseversion}} --ci  -VV
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Your problem is you misspell depth in fetch-dept: 0 use fetch-depth: 0 and it fetches multiple commits and display in Changelog and GH Release

elationbase avatar Jul 30 '24 14:07 elationbase