Code Monkey home page Code Monkey logo

auto-generate-changelog's Introduction

auto-generate-changelog

Codacy Badge GitHub release (latest by date) language-python LICENSE Apache-2.0

A Github Action to generate CHANGELOG automatically according to conventional commits.

Feel free to submit a pull request or an issue, but make sure to follow the templates.

Welcome contributors to improve this project together!

If you like this, please give me a star!

Usage

Create a workflow file such as .github/workflows/changelog.yml (you can find it in this repo)

name: Generate changelog
on:
  release:
    types: [created, edited]

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - uses: BobAnkh/[email protected]
      with:
        REPO_NAME: '<YourUserName>/<YourRepoName>'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        PATH: 'CHANGELOG.md'
        COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
        TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'

NOTE: Generating CHANGELOG needs all the commit history so you should set fetch-depth: 0 with actions/checkout

NOTE: commit log begins with docs(changelog) or doc(CHANGELOG) will not be added to the CHANGELOG

Inputs

Please see NOTES below the table for how to set some of the parameters.

Inputs Description Required Default
REPO_NAME Repository name no '' which means current repository
ACCESS_TOKEN Github Access Token. See NOTES 1 yes You can just pass ${{secrets.GITHUB_TOKEN}}
PATH Path to the your file no CHANGELOG.md
BRANCH The branch to update file specified in PATH no '' which means default branch
PULL_REQUEST Open a new pull request if set to a target branch name. See NOTES 2 no '' which means not open pull request by default
COMMIT_MESSAGE Commit message no docs(CHANGELOG): update release notes
TYPE The type of commits you want to add to CHANGELOG. See NOTES 3 no 'feat:Feature,fix:Fix'
COMMITTER The committer you want to use to update file. See NOTES 4 no '' which means default committer
DEFAULT_SCOPE The default scope to hold all unscoped commits no general
SUPPRESS_UNSCOPED Whether to exclude unscoped commits no false
UNRELEASED_COMMITS Whether to include unreleased commits in the changelog no false
REGENERATE_COUNT Regenerate n recent releases' changelog. See NOTES 5 no 0
REPLACE_EMPTY_RELEASE_INFO Replace empty release info with some words no false

NOTES 1: ${{secrets.GITHUB_TOKEN}} has a rate limit smaller than Personal Access Token (PAT), so if you have much more requests(commits, prs, etc.) or face a 403 rate-limit-error, use PAT instead.

NOTES 2: PULL_REQUEST must be used with BRANCH together, both should be provided with a valid branch name if you want to open a pull request. The GA will open a pull request from the BRANCH (head branch) to the PULL_REQUEST (base branch). Leave PULL_REQUEST blank if you don't want to open a pull request.

NOTES 3: You can define the keyword detected from commit message and the corresponding word presented in the changelog in input TYPE. For example, define feat:Feature,fix:Bug Fixes will have commit messages like feat(main): add new option to be presented in changelog under part Feature and have commit messages like fix(server): adjust rendering to be presented in changelog under part Bug Fixes.

NOTES 4: COMMITTER should be in the format: 'author <author@email>'

NOTES 5: All the releases not exist in the changelog will of course be added to the changelog. Use this parameter to regenerate the last n releases' changelog. Default set to 0 means only generate for new releases. You can set to -1 to regenerate all the releases.

NOTES 6: You can use the format below to avoid some lines in release description to appear in the CHANGELOG:

<!-- HIDE IN CHANGELOG BEGIN -->
See CHANGELOG for more details. This line will be hided when changelog is generated.
<!-- HIDE IN CHANGELOG END -->

Maintainer

@BobAnkh

How to contribute

You should follow our Code of Conduct.

See CONTRIBUTING GUIDELINES for contributing conventions.

Make sure to pass all the tests before submitting your code. You can conduct pytest -ra at the root directory to run all tests.

You can use local mode when develope it on your local machine, here is the command-line help info:

usage: main.py [-h] [-m MODE] [-f FILE] [-o OUTPUT] [-t TOKEN]

optional arguments:
  -h, --help            show this help message and exit
  -m MODE, --mode MODE  choose to use local-dev mode or on github action mode.
                        Valid values are 'local' or 'github'
  -f FILE, --file FILE  configuration file to read from when running local-dev
                        mode
  -o OUTPUT, --output OUTPUT
                        output file when running local-dev mode
  -t TOKEN, --token TOKEN
                        Github Access Token

Contributors

Yixin
Yixin Shen
Jonathan
Jonathan Mang
Sebastian
Sebastian Rühl

LICENSE

Apache-2.0 © BobAnkh

auto-generate-changelog's People

Contributors

bobankh avatar dependabot[bot] avatar github-actions[bot] avatar joundso avatar mergify[bot] avatar sruehl 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

Watchers

 avatar  avatar

auto-generate-changelog's Issues

Workflow Not Updating Changelog: Empty File Generated

Describe the bug

The workflow does not add changes to the changelog. Each time the workflow runs, it generates an empty changelog file. Even after making multiple commits (e.g., 4-5 commits) and then running the workflow, the changelog file remains unchanged.

image

To Reproduce

Below is the content of my changelog.yml file for reference:

name: Generate changelog
on:
  release:
    types: [created, edited]
  workflow_dispatch:

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - uses: BobAnkh/[email protected]
      with:
        REPO_NAME: 'my repo name'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        PATH: 'CHANGELOG.md'
        BRANCH: test-changelog
        COMMIT_MESSAGE: 'chore: CHANGELOG.md updated'
        TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'

Expected behavior

The changelog file should be updated after the workflow runs.

  • OS: \ mac
  • Browser \ chrome
  • node \ 20

[bug] make it so that the action can submit a pull request to update the changelog

Is your feature request related to a problem? Please describe

My problem is that my main branch is protected with some required statuses that much be passed. The action tries to push it to the branch directly instead of using a pull request to submit new changes. Which gives this error:

github.GithubException.GithubException: 409 {"message": "Could not update file: 2 of 2 required status checks are expected. Changes must be made through a pull request.", "documentation_url": "docs.github.com/articles/about-protected-branches"}

Description of the new feature/enhancement

I would want the action to either submit a new pull request to update the changelog, or to update the changelog inside of the pull request itself.

Proposed technical implementation details (optional)

A clear and concise description of any solutions you've considered.

Additional context

Add any other context or screenshots about the feature request here.

[enhancement] support no-remote mode to get commits message

Is your feature request related to a problem? Please describe

It is slow for the action to get a lot of commits from Github's api. So I decide to support to get commits message from local repo, which needs to cooperate with action/checkout.

Description of the new feature/enhancement

As above.

Proposed technical implementation details (optional)

Organize the local git log to the same data structure.

Additional context

Can we specify which branch to push to?

Hey, I'd like to specify which branch to push to, so I can avoid pushing to a protected branch. I have a branch that is protected i.e main and release for releases. Is there a way I can commit the ChangeLog to release and push?

Right now it seems to fail with the following error:

github.GithubException.GithubException: 409 {"message": "Could not update file: At least 1 approving review is required by reviewers with write access.", "documentation_url": "https://docs.github.com/articles/about-protected-branches"}

which makes me feel like it by default trying to push to the main branch, despite action or workflow being triggered by push/merge to release - which is not protected. I have my config as below:

name: Release
on:
  push:
    branches:
      - release

       - name: Generate CHANGELOG.md
        id: generate_change_log
        uses: BobAnkh/auto-generate-changelog@master
        with:
          REPO_NAME: 'RowlandOti/E-CommerceApp-Merchant'
          ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
          PATH: '/CHANGELOG.md'
          COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
          TYPE: 'ci:Continuous Integration,test:Tests,feat:New Features,fix:Bug Fixes,lint:Code Style Fixes,docs:Documentation,refactor:Refactors,perf:Performance Improvements'

Please note that I do not want to change secrets.GITHUB_TOKEN to include administrators as that defeats the purpose of the branch protection.

[enhancement] Use {version} in commit message to point to the release tag

Is your feature request related to a problem? Please describe

It is common to have version info in commits related to changelog.

Description of the new feature/enhancement

Can use {version} in commit message to point to the release version.

e.g., docs(CHANGELOG): release notes for {version} can be translated into docs(CHANGELOG): release note for v0.0.4

Proposed technical implementation details (optional)

Python format string. PyGithub to get latest release tag or pass input from workflow file

Can add a new input called version default to use latest version tag and can be set to use event-trigger release tag.

[bug] Docker build failed with code 100

Describe the bug

The execution of the action fails at build v1.0.4

To Reproduce

I just have the same YML file as this repo.
When I push a new commit the workflow starts executing and fails at build time

Expected behavior

Build and Run should complete with no problems

Additional context

Action log:

Build container for action use: '/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4/Dockerfile'.
  /usr/bin/docker build -t da7a08:2cc8bbe855834cf0b86cc1b558947a91 -f "/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4/Dockerfile" "/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4"
  Sending build context to Docker daemon  138.8kB
  
  Step 1/5 : FROM python:3.9.6-slim
  3.9.6-slim: Pulling from library/python
  99046ad9247f: Pulling fs layer
  dae61f727682: Pulling fs layer
  466485ee6277: Pulling fs layer
  de739b056673: Pulling fs layer
  1374279231a5: Pulling fs layer
  de739b056673: Waiting
  1374279231a5: Waiting
  dae61f727682: Verifying Checksum
  dae61f727682: Download complete
  466485ee6277: Verifying Checksum
  466485ee6277: Download complete
  99046ad9247f: Verifying Checksum
  99046ad9247f: Download complete
  de739b056673: Verifying Checksum
  de739b056673: Download complete
  1374279231a5: Verifying Checksum
  1374279231a5: Download complete
  99046ad9247f: Pull complete
  dae61f727682: Pull complete
  466485ee6277: Pull complete
  de739b056673: Pull complete
  1374279231a5: Pull complete
  Digest: sha256:4115592fd02679fb3d9e8c513cae33ad3fdd64747b64d32b504419d7118bcd7c
  Status: Downloaded newer image for python:3.9.6-slim
   ---> c6e50ab8d425
  Step 2/5 : RUN apt-get update &&     apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3 &&     rm -rf /var/lib/apt/lists/*
   ---> Running in 15b494cbe627
  Get:1 http://deb.debian.org/debian bullseye InRelease [113 kB]
  Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
  Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
  Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [25.8 kB]
  Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8178 kB]
  Fetched 8397 kB in 2s (5508 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Version '1:2.20.1-2+deb10u3' for 'git' was not found
  The command '/bin/sh -c apt-get update &&     apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3 &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
  
  Warning: Docker build failed with exit code 100, back off 2.585 seconds before retry.
  /usr/bin/docker build -t da7a08:2cc8bbe855834cf0b86cc1b558947a91 -f "/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4/Dockerfile" "/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4"
  Sending build context to Docker daemon  138.8kB
  
  Step 1/5 : FROM python:3.9.6-slim
   ---> c6e50ab8d425
  Step 2/5 : RUN apt-get update &&     apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3 &&     rm -rf /var/lib/apt/lists/*
   ---> Running in 78b2652d8a00
  Get:1 http://deb.debian.org/debian bullseye InRelease [113 kB]
  Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
  Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
  Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [25.8 kB]
  Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8178 kB]
  Fetched 8397 kB in 2s (5542 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Version '1:2.20.1-2+deb10u3' for 'git' was not found
  The command '/bin/sh -c apt-get update &&     apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3 &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
  
  Warning: Docker build failed with exit code 100, back off 4.946 seconds before retry.
  /usr/bin/docker build -t da7a08:2cc8bbe855834cf0b86cc1b558947a91 -f "/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4/Dockerfile" "/home/runner/work/_actions/BobAnkh/auto-generate-changelog/v1.0.4"
  Sending build context to Docker daemon  138.8kB
  
  Step 1/5 : FROM python:3.9.6-slim
   ---> c6e50ab8d425
  Step 2/5 : RUN apt-get update &&     apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3 &&     rm -rf /var/lib/apt/lists/*
   ---> Running in 73912dc04669
  Get:1 http://deb.debian.org/debian bullseye InRelease [113 kB]
  Get:2 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
  Get:3 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
  Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8178 kB]
  Get:5 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [25.8 kB]
  Fetched 8397 kB in 1s (5847 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Version '1:2.20.1-2+deb10u3' for 'git' was not found
  The command '/bin/sh -c apt-get update &&     apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3 &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
  
Error: Docker build failed with exit code 100

[enhancement] Extract generator to an individual cli-tool

Is your feature request related to a problem? Please describe

Extract generator to an individual cli-tool called auto-generate-changelog-cli.

Description of the new feature/enhancement

Extract generator to an individual cli-tool called auto-generate-changelog-cli.

Proposed technical implementation details (optional)

To do

Additional context

[enhancement] support other branches

Is your feature request related to a problem? Please describe

It doesn't support to update CHANGELOG file on other branches now.

Description of the new feature/enhancement

Support other branches.

Proposed technical implementation details (optional)

Similar to this pr

Additional context

[enhancement] Auto-detect repo

Is your feature request related to a problem? Please describe

It is easy to configure a wrong repo name by mistake.

Description of the new feature/enhancement

Detect the repo name and user name when triggered by workflow.

Proposed technical implementation details (optional)

With Gtihub API

Additional context

[enhancement] add an option to choose whether to use `<scope>`

Is your feature request related to a problem? Please describe

The changelog generater is designed for commits that follows angularjs's convention. The <header> should be like this: <type>(<scope>): <subject>. However, <scope> is optional in many projects, so I think it is better for users to choose if generater detects <scope>

Description of the new feature/enhancement

An new option to choose if detect <scope> in commit message <header>. It is set to true be default, which means to detect it.

Proposed technical implementation details (optional)

If this new option is set to false, then the program will match <type>: or <type>(<scope>): but ignore <scoope>.

Additional context

[enhancement] add local mode

Is your feature request related to a problem? Please describe

The main script now can only be conducted on Github Action, for it is using information from workflow(in yaml format). It is not convenient for developers to debug in their own PC.

Description of the new feature/enhancement

Add a new argument -m to choose mode. Default set to github, which means to read parameters from workflow. Set -m local means use local input or config file. Alse, local mode doesn't upload the content generated.

Proposed technical implementation details (optional)

As above.

Additional context

[bug] Unscoped commits should use all scope

Describe the bug

when doing commits without the optional scope feat: fixed something they aren't picked up by auto-gen.

this should solve #11

To Reproduce

commit something with feat: fixed something and see that it doesn't appear.

Expected behavior

commit something with feat: fixed something and see that it does appear.

Environment

all

[enhancement] Refactor codes to seperate data structure

Is your feature request related to a problem? Please describe

Interface to Github should be extracted to a individual class, so that we can add more tests to cover the codes. See BobAnkh/add-contributors.

Description of the new feature/enhancement

As mentioned above.

Proposed technical implementation details (optional)

As mentioned above.

Additional context

[enhancement] add `BREAKING CHANGES` to changelog

Is your feature request related to a problem? Please describe

It is important to imform the users of breaking changes in changelog

Description of the new feature/enhancement

Detect BREAKING CHANGES in commit message and add it to changelog

Proposed technical implementation details (optional)

As above

Additional context

[question] Fetching .RateLimitExceededException: 403 instead of a changelog generation

I try to use the sample below.

on:
  push:
    branches:
      - develop
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - uses: BobAnkh/auto-generate-changelog@master
      with:
        REPO_NAME: 'my_name/my_repo'
        ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        PATH: 'CHANGELOG.md'
        COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
        TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'

But fetch an error:

  File "/main.py", line 519, in <module>
    main()
  File "/main.py", line 506, in main
    changelog.get_data()
  File "/main.py", line 200, in get_data
    if pulls.totalCount == 0:
  File "/usr/local/lib/python3.9/site-packages/github/PaginatedList.py", line 149, in totalCount
    headers, data = self.__requester.requestJsonAndCheck(
  File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 353, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.RateLimitExceededException: 403 {"message": "API rate limit exceeded for installation ID 15490637.", "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Commits progress:  14%|█▎        | 953/7015 [03:20<21:13,  4.76it/s]

So what is wrong?

[enhancement] Increment changelog generate

Is your feature request related to a problem? Please describe

Because Github limits the requests per hour, so if the repo contains too much commits, then it won't possible to generate whole changelog every time.

Description of the new feature/enhancement

Provide an option to let user turn on increment changelog generate: only new release will be generated.

Proposed technical implementation details (optional)

Check the release meta data: commit sha of the tag and the release time.

Additional context

Add any other context or screenshots about the feature request here.

How to overcome "API rate limit exceeded for installation" error?

Thank you for this great bot! I'd really like to see it in action in this repository.

However, I was surprised to encounter two problems:

  1. Although a new release was made, the Bot was not automatically triggered. I had to add a workflow dispatch to start it manually. What do I have to change in the configuration to make it run automatically after each new release?
  2. When I ran it manually, I received the following error (click here to check the full output of the workflow):
[INFO] Regenerate releases: ['v2.1.2', 'v2.1.1', 'v2.1.0', 'v2.0.3', 'v2.0.2', 'v2.0.1', 'v2.0.0', 'v1.2.2', 'v1.2.1', 'v1.2.0', 'v1.1.0', 'v1.0.5', 'v1.0.4', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.2', 'v0.7.1', 'v0.7.0', 'v0.6.0', 'v0.5.0', 'v0.4.0', 'v0.3.0', 'v0.2.0', 'v0.1.2', 'v0.1.1']
Error:  Failed to get release content, message: {'message': 'API rate limit exceeded for installation ID 18128119. If you reach out to GitHub Support for help, please include the request ID DC80:0E08:F85C03:20A6DCE:6558F8C5.', 'documentation_url': 'https://docs.github.com/rest/overview/rate-limits-for-the-rest-api'}
Error:  Failed to get release content, status code: 403

My guess is - since it isn't a new repo - that the Bot exceeds an internal GitHub API rate limit while trying to process all existing releases at once. I tried rerunning the bot after about 2 hours without running any other bot but with the same result. Any ideas how I can handle this situation?


EDIT: Just re-read the notes and found the following hint:

NOTES 1: ${{secrets.GITHUB_TOKEN}} has a rate limit smaller than Personal Access Token (PAT), so if you have much more requests(commits, prs, etc.) or face a 403 rate-limit-error, use PAT instead.

I think that will solve my second issue. I'll give it a try.

However, if you have any ideas what goes wrong concerning my first question, please let me know :)

[enhancement] add an option to choose whether upload changelog to release info

Is your feature request related to a problem? Please describe

CHANGELOG can be automatically added to the description of a release.

Description of the new feature/enhancement

Give a new option to choose whether add CHANGELOG to the description of a release automatically.

Proposed technical implementation details (optional)

According to tag's name and release name, the CHANGELOG which belongs to that release can be automatically added to the end of the release description. And if the same content is already here, then it won't do anything.

Plan to use PyGithub to achieve this.

Additional context

[enhancement] ignore commits if they are reverted by other commits in the same release version

Is your feature request related to a problem? Please describe

Commits should be ignored if they are reverted by other commits in the same release version. Those of different release versions should be added.

Description of the new feature/enhancement

The same as the above part.

Proposed technical implementation details (optional)

If a commit revert a commit in the same release version, then both of them should be ignored. But if they are in different release version, both of them should be added and a new type of named revert should be added too.

Additional context

Add any other context or screenshots about the feature request here.

[enhancement] Posibility to autoaprove Pull Request

Is your feature request related to a problem? Please describe

Posibility to autoaprove Pull Request with branches protection rules

Description of the new feature/enhancement

FLAG,

With: PULL_REQUEST_AUTOAPPROVE: 'true' :

Create Branch

Create PR

Merge

Delete Branch

[enhancement] join together the header and the only line in body when using `...` in the message

Is your feature request related to a problem? Please describe

Users may use ... at the end of the commit <header> when this line exceeds the characters limitation and use another ... at the beginning of the only line in the <body> section.

Description of the new feature/enhancement

The action should join them together

Proposed technical implementation details (optional)

As above.

Additional context

[bug] using the pull request config removes every other changelog entry

Describe the bug

When pushing a new update, the workflow updates the the current update, but then removes the other entries.

To Reproduce

NOTE:Self-contained, minimal reproducing samples are extremely helpful and will expedite addressing your issue

Steps to reproduce the behavior:

  1. Make an update
  2. Wait for workflow to update changelog
  3. Observe

Expected behavior

It shouldn't delete the other entries, and should only update that current update

Screenshots

https://github.com/mmattDonk/AI-TTS-Donations/pull/155/files

(backup screenshots just in case that pr changes)
image
image
image

Environment

https://github.com/mmattDonk/AI-TTS-Donations/blob/main/.github/workflows/changelog.yml

E: Packages were downgraded and -y was used without --allow-downgrades. [bug]

Describe the bug

When running the action, the docker build for BobAnkh/[email protected] & BobAnkh/[email protected] are failing with the following error:

E: Packages were downgraded and -y was used without --allow-downgrades.

To Reproduce

Run the action from github actions. The docker build for the action will fail.

NOTE:Self-contained, minimal reproducing samples are extremely helpful and will expedite addressing your issue

Expected behavior

No failure

A clear and concise description of what you expected to happen.

Screenshots

error

If applicable, add screenshots to help explain your problem.

Environment

  • Device: [e.g. iPhone6]
  • OS: [e.g. Ubuntu 18.04LTS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

[enhancement] Unrelease part should be removed if there is nothing

Is your feature request related to a problem? Please describe

When the changelog is generated as a release is created, the unreleased part is often empty, which should be removed.

Description of the new feature/enhancement

As mentioned abouve

Proposed technical implementation details (optional)

When nothing in the unreleased part, it will be removed.

Additional context

[bug] I cannot generate changelog due to NoneType object has no attribute group Error

Describe the bug

I was running changelog event under github actions. But getting below error as response . That's why I cannot generate changelog .

=========Here is the runner log============
Collecting charset-normalizer<3,>=2 Downloading charset_normalizer-2.1.0-py3-none-any.whl (39 kB) Collecting certifi>=2017.4.17 Downloading certifi-2022.6.15-py3-none-any.whl (1[60](https://github.com/arif98741/decathlon-project/runs/7529632918?check_suite_focus=true#step:4:61) kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 362.9 MB/s eta 0:00:00 Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.11-py2.py3-none-any.whl (139 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.9/139.9 kB 343.9 MB/s eta 0:00:00 Collecting idna<4,>=2.5 Downloading idna-3.3-py3-none-any.whl ([61](https://github.com/arif98741/decathlon-project/runs/7529632918?check_suite_focus=true#step:4:62) kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 311.8 MB/s eta 0:00:00 Collecting wrapt<2,>=1.10 Downloading wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_[64](https://github.com/arif98741/decathlon-project/runs/7529632918?check_suite_focus=true#step:4:65).manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 309.5 MB/s eta 0:00:00 Collecting pycparser Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 337.2 MB/s eta 0:00:00 Installing collected packages: wrapt, urllib3, tqdm, PyYAML, pyjwt, pycparser, idna, charset-normalizer, certifi, requests, deprecated, cffi, pynacl, PyGithub WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Successfully installed PyGithub-1.55 PyYAML-6.0 certifi-2022.6.15 cffi-1.15.1 charset-normalizer-2.1.0 deprecated-1.2.13 idna-3.3 pycparser-2.21 pyjwt-2.4.0 pynacl-1.5.0 requests-2.28.1 tqdm-4.64.0 urllib3-1.26.11 wrapt-1.14.1 Traceback (most recent call last): File "/main.py", line [65](https://github.com/arif98741/decathlon-project/runs/7529632918?check_suite_focus=true#step:4:66)3, in <module> main() File "/main.py", line 643, in main changelog.get_data() File "/main.py", line 1[75](https://github.com/arif98741/decathlon-project/runs/7529632918?check_suite_focus=true#step:4:76), in get_data self.get_exist_changelog() File "/main.py", line 2[82](https://github.com/arif98741/decathlon-project/runs/7529632918?check_suite_focus=true#step:4:83), in get_exist_changelog self.analyze_changelog() File "/main.py", line 302, in analyze_changelog release_tag = re.search(r'\[.*?\]', release_body).group()[1:-1] AttributeError: 'NoneType' object has no attribute 'group'

To Reproduce

NOTE:Self-contained, minimal reproducing samples are extremely helpful and will expedite addressing your issue

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

I want it be done without any issue. I previously generated changelog without any issue at all. But today I am getting . This is pretty surprising.

Screenshots

1
2

Environment

  • Device: [e.g. HP-Laptop]
  • OS: [e.g. Win 10]
  • Browser [e.g. chrome, firefox]
  • Version [e.g. 103]

Additional context

Remove no description and general scope

Hi, I have a couple of questions which from my POV are rather a nice to have for decreasing cognitive load when reading a changelog.

  • Every time I do a release with an empty description I see the sentence *No description* within the changelog. Why? Would it be possible to hide it as it adds zero value?
  • Is it possible to hide the scope general? Maybe we just don't want anything. Meaning when I commit something like git commit -m 'feat: add feature 1' I would just like to see something:
FEATURES
    - add feature 1
    - add feature 2

Thank you so much

[enhancement] Upload the results of Pytest as comment

Is your feature request related to a problem? Please describe

Github has recently add two new event that could trigger workflow: pull_request_target and workflow_run. This makes it possible to use the result of a workflow triggered by pull request to create a comment in the pull request.

Description of the new feature/enhancement

  1. Write an action to run pytest and upload the results in artifacts as well as the output.
  2. Write an action that could be triggered by workflow_run to use the artifacts to create a comment in the pull request

Proposed technical implementation details (optional)

  • Install Pytest and upload results as artifacts. This could be done within the dockerfile and entrypoint.sh
  • Use the artifacts to create a comment in the pull request.

Additional context

[bug] Could not create a pr with attribute PULL_REQUEST

Describe the bug

Because of branch protection, I want to modify CHANGELOG.md file by creating pr. But after I set the PULL_REQUEST and BRANCH properties it didn't create successfully.

To Reproduce

NOTE:Self-contained, minimal reproducing samples are extremely helpful and will expedite addressing your issue

Steps to reproduce the behavior:

this is my config.

- uses: BobAnkh/[email protected]
  with:
    ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
    PATH: 'CHANGELOG.md'
    COMMIT_MESSAGE: 'docs(changelog): update release notes'
    TYPE: 'feat:Feature,fix:Bug Fixes,refactor:Refactor,perf:Performance Improvements'
    PULL_REQUEST: 'changelog'
    BRANCH: 'master'

Expected behavior

successfully created pr

Screenshots

If applicable, add If applicable, add screenshots to help explain your problem.screenshots to help explain your problem.

Environment

  • Device: [e.g. iPhone6]
  • OS: [e.g. Ubuntu 18.04LTS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

Run BobAnkh/[email protected]
/usr/bin/docker run --name fca41e4d2d56442499ca349a9d9ca545_90cb8e --label 290506 --workdir /github/workspace --rm -e "INPUT_ACCESS_TOKEN" -e "INPUT_PATH" -e "INPUT_COMMIT_MESSAGE" -e "INPUT_TYPE" -e "INPUT_PULL_REQUEST" -e "INPUT_BRANCH" -e "INPUT_REPO_NAME" -e "INPUT_COMMITTER" -e "INPUT_DEFAULT_SCOPE" -e "INPUT_SUPPRESS_UNSCOPED" -e "INPUT_UNRELEASED_COMMITS" -e "INPUT_REGENERATE_COUNT" -e "INPUT_REPLACE_EMPTY_RELEASE_INFO" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/tlcsdm-common/tlcsdm-common":"/github/workspace" 290506:fca41e4d2d56442499ca349a9d9ca545
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (22.0.4)
Collecting pip
  Downloading pip-22.3.1-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 128.4 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/site-packages (58.1.0)
Collecting setuptools
  Downloading setuptools-65.6.3-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 176.5 MB/s eta 0:00:00
Requirement already satisfied: wheel in /usr/local/lib/python3.10/site-packages (0.37.1)
Collecting wheel
  Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, setuptools, pip
  Attempting uninstall: wheel
    Found existing installation: wheel 0.37.1
    Uninstalling wheel-0.37.1:
      Successfully uninstalled wheel-0.37.1
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.1.0
    Uninstalling setuptools-58.1.0:
      Successfully uninstalled setuptools-58.1.0
  Attempting uninstall: pip
    Found existing installation: pip 22.0.4
    Uninstalling pip-22.0.4:
      Successfully uninstalled pip-22.0.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Successfully installed pip-22.3.1 setuptools-65.6.3 wheel-0.38.4
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting PyGithub==1.55
  Downloading PyGithub-1.55-py3-none-any.whl (291 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 291.7/291.7 kB 57.1 MB/s eta 0:00:00
Collecting PyYAML==6.0
  Downloading PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 682.2/682.2 kB 206.8 MB/s eta 0:00:00
Collecting tqdm==4.64.0
  Downloading tqdm-4.64.0-py2.py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.4/78.4 kB 160.0 MB/s eta 0:00:00
Collecting pyjwt>=2.0
  Downloading PyJWT-2.6.0-py3-none-any.whl (20 kB)
Collecting pynacl>=1.4.0
  Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux20[14](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:15)_x86_64.manylinux_2_24_x86_64.whl (856 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 149.6 MB/s eta 0:00:00
Collecting deprecated
  Downloading Deprecated-1.2.13-py2.py3-none-any.whl (9.6 kB)
Collecting requests>=2.14.0
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 144.0 MB/s eta 0:00:00
Collecting cffi>=1.4.1
  Downloading cffi-1.[15](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:16).1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.8/441.8 kB 177.1 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.9.24-py3-none-any.whl ([16](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:17)1 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 147.9 MB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 131.3 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 133.2 MB/s eta 0:00:00
Collecting wrapt<2,>=1.10
  Downloading wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_[17](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:18)_x86_64.manylinux2014_x86_64.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 134.2 MB/s eta 0:00:00
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (1[18](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:19) kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 114.9 MB/s eta 0:00:00
Installing collected packages: wrapt, urllib3, tqdm, PyYAML, pyjwt, pycparser, idna, charset-normalizer, certifi, requests, deprecated, cffi, pynacl, PyGithub
Successfully installed PyGithub-1.55 PyYAML-6.0 certifi-[20](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:21)22.9.24 cffi-1.15.1 charset-normalizer-2.1.1 deprecated-1.2.13 idna-3.4 pycparser-2.[21](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:22) pyjwt-2.6.0 pynacl-1.5.0 requests-2.28.1 tqdm-4.64.0 urllib3-1.[26](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:27).13 wrapt-1.14.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Traceback (most recent call last):
[INFO] Regenerate releases: ['v1.4.1', 'v1.4.0']
  File "/main.py", line 659, in <module>
[INFO] All regenerate_releases are generated
[INFO] Update changelog
    main()
  File "/main.py", line 655, in main
    changelog.write_data()
  File "/main.py", line 395, in write_data
    self.repo.update_file(self.path, self.commit_message,
  File "/usr/local/lib/python3.10/site-packages/github/Repository.py", line 2154, in update_file
    headers, data = self._requester.requestJsonAndCheck(
  File "/usr/local/lib/python3.10/site-packages/github/Requester.py", line [35](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:36)3, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.10/site-packages/github/Requester.py", line [37](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:38)8, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: [40](https://github.com/unknowIfGuestInDream/tlcsdm-common/actions/runs/3556610411/jobs/5974094716#step:4:41)9 {"message": "Could not update file: 6 of 6 required status checks are expected. Changes must be made through a pull request.", "documentation_url": "https://docs.github.com/articles/about-protected-branches"}

[bug] regex for optional scope does not include :

Describe the bug

the regex should only match id(optionalsope): something something.

e.g. for the expression ^feat(?:[(](.+?)[)])? it matches currently:

  • correct feat: new feature
  • correct feat(comp): new componentfeature
  • incorrect featulalalala this is a radom commit

switching the expression to ^feat(?:[(](.+?)[)])?: fixes this issue.

Care must be taken as this line subject = re.sub(regex + r'\s?:\s?', '', head) appends the colon so this needs to be adjusted too.

To Reproduce

use a commit like fixed something or featuring something great (non conventional commit in a nutshell) will appear under the fixed or feature section.

Expected behavior

only match real conventional commits

[enhancement] merge different types into an option called `type`

Is your feature request related to a problem? Please describe

It has too much options for users to configure the types.

Description of the new feature/enhancement

Merge all types into one option called type in which you can define the keyword detected from commit message and the corresonding word presented in the changelog. For example, define feat:Feature will detect commit message like feat(main): add new option and present this in changelog as part Feature. This can let users define new type by themselves.

Proposed technical implementation details (optional)

Extract this part to be an individual function to deal with this. Also return None if nothing in the section.

Additional context

[enhancement] Hide lines in release info when copy it to changelog

Is your feature request related to a problem? Please describe

It would be more beautiful for some lines in release info like See CHANGELOG for more details not to appear in the changelog.

Description of the new feature/enhancement

Users can use comment block to surround the lines that would not appear in changelog.

Use format like below will hide the line in CHANGELOG:

<!-- HIDE IN CHANGELOG BEGIN -->
See CHANGELOG for more details.
<!-- HIDE IN CHANGELOG END -->

Proposed technical implementation details (optional)

Match the block in release info and remove them.

Additional context

[enhancement] add related issues mentioned in commit message footer

Is your feature request related to a problem? Please describe

Sometimes users may link commits to the relevant issues in the footer of the commit message.

Description of the new feature/enhancement

Parse the footer of a commit message to see if it includes an issue and add it to the changelog.

Proposed technical implementation details (optional)

As above

Additional context

[enhancement] add an option to ignore some commits

Is your feature request related to a problem? Please describe

Some commits like docs(changelog): xxxx should be ignored and not appear in changelog.

Description of the new feature/enhancement

When add some thing like <type>(<scope>), e.g.docs(changelog), to this option, it will be used as an regex to match the commit message to decide if ignore it.

Proposed technical implementation details (optional)

As above.

Additional context

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.