简体   繁体   English

常规-github-releaser 没有选择 CHANGELOG.md 作为 Github 版本描述

[英]conventional-github-releaser doesn't pick up CHANGELOG.md as Github release description

I'm using standard-version (version 9.3.2) to manage the version of my npm package, as well as generating a CHANGELOG.md.我正在使用standard-version (版本 9.3.2)来管理我的 npm package 的版本,以及生成 CHANGELOG.md。 This works fine as it seems.这看起来很好。

Additionally to this, I want to create a Github release when the version tag is pushed to git.除此之外,当版本标签被推送到 git 时,我想创建一个 Github 版本。 So I have created the following Github Action:所以我创建了以下 Github 动作:

name: Continuous deployment (NPM)

on:
  push:
    tags:
      - v*

jobs:
  build-and-deploy:
    name: Build and deploy NPM package
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Configure node for npmjs.org as registry
        uses: actions/setup-node@v2
        with:
          node-version: '16.x'
          registry-url: 'https://registry.npmjs.org'

      - name: Install dependencies
        run: npm ci

      - run: npm run release:create-github-release
        env:
          CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}

      - name: Publish package on npmjs.org
        run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

There is a step where I call npm run release:create-github-release , which runs "release:create-github-release": "conventional-github-releaser -p angular" .有一个步骤我调用npm run release:create-github-release ,它运行"release:create-github-release": "conventional-github-releaser -p angular" A release is generated, but unfortunately it doesn't contain the CHANGELOG.md which was previously generated and is committed to the repository at the time of running the mentioned Github Action.生成了一个版本,但不幸的是,它不包含之前生成的CHANGELOG.md ,它在运行上述 Github 操作时已提交到存储库。 It looks like this:它看起来像这样:

错误的 Github 发布

My question is: Why doesn't conventional-github-releaser pick up my CHANGELOG.md ?我的问题是:为什么conventional-github-releaser releaser 不拿起我的CHANGELOG.md

The whole project can be found here: https://github.com/openscript-ch/gatsby-plugin-i18n-l10n整个项目可以在这里找到: https://github.com/openscript-ch/gatsby-plugin-i18n-l10n

Thank you for any advice.谢谢你的任何建议。

Following could be a guess (based on docs I read about conventional-github-releaser and actions/checkout ), so I'm not 100% sure:以下可能是一个猜测(基于我读到的关于conventional-github-releaseractions/checkout的文档),所以我不能 100% 确定:

When you use actions/checkout@v2 it sets to default fetch-depth: 1 which does a shallow checkout of your repository ie single commit is fetched by default (btw this you can see in you GHA as well, I attached a snapshot) and this could be most likely the reason why conventional-github-releaser couldn't pickup previous content of CHANGELOG.md as that command only "...generates a GitHub Release based on commits since the last semver tag...".当您使用actions/checkout@v2时,它设置为默认fetch-depth: 1 ,它对您的存储库进行浅层检出,即默认获取单个提交(顺便说一句,您也可以在 GHA 中看到,我附上了一个快照)和这很可能是conventional-github-releaser releaser 无法拾取CHANGELOG.md的先前内容的原因,因为该命令仅“...根据自上一个 semver 标签以来的提交生成 GitHub 版本...”。 When you set this explicitly to fetch-depth: 0 it fetches all git history for all branches and tags.当您将其显式设置为fetch-depth: 0时,它将获取所有分支和标签的所有 git 历史记录。 Try and let me know as I'm interested what's the outcome.试着让我知道,因为我很感兴趣结果是什么。

REF:参考:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM