Skip to content
New issue

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

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

Already on GitHub? # to your account

Github release changelog contains only last commit #1074

Open
placzkowskim opened this issue Jan 18, 2024 · 7 comments
Open

Github release changelog contains only last commit #1074

placzkowskim opened this issue Jan 18, 2024 · 7 comments

Comments

@placzkowskim
Copy link

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 "xx@gmail.com"
          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.

@webpro
Copy link
Collaborator

webpro commented Jan 18, 2024

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.

@placzkowskim
Copy link
Author

placzkowskim commented Jan 18, 2024

@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

@northword
Copy link
Contributor

may set checkout deep = 0?

@juancarlosjr97
Copy link
Contributor

juancarlosjr97 commented Feb 10, 2024

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

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

@placzkowskim
Copy link
Author

placzkowskim commented Mar 8, 2024

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 "xx@xx.com"
          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}}

@lvzhenbo
Copy link

lvzhenbo commented Jul 9, 2024

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

@elationbase
Copy link

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 "xx@xx.com"
          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

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

No branches or pull requests

6 participants