heinrichreimer / action-github-changelog-generator

✏️ Automatically generate change log from your tags, issues, labels and pull requests on GitHub.
MIT License
127 stars 34 forks source link

Missing merged/closed pull-requests from report? #19

Open ThomasAdam opened 3 years ago

ThomasAdam commented 3 years ago

Describe the bug

I used to use ferrarimarco/github-changelog-generator via docker manually to produce a CHANGELOG.md file. Since learning of your Github Actions command, I've switched to that, and noticed some discrepancies in the output.

This has lead to ferrarimarco/github-changelog-generator docker image producing different results to heinrichreimer/action-github-changelog-generator.

Reproduce

Steps to reproduce the behavior:

  1. In a repository of your choice (and assuming you can run Docker), run:
docker run -it --rm -v $(pwd):$(pwd) ferrarimarco/github-changelog-generator -t <github token> --user <github_user> --project <github_project> -o "$(pwd)/CHANGELOG.md"

Where:

Expected behavior

In comparing the output from both runs, the invocation from ferrarimarco/github-changelog-generator will show an inclusion of merged pull-requests, where using heinrichreimer/action-github-changelog-generator does not.

Here is the options from ferrarimarco/github-changelog-generator:

Using these options:                                                                                                                                                                                    
:date_format=>"%Y-%m-%d"                                                                                                                                                                                
:output=>"/home/n6tadam/projects/fvwm/fvwm3/CHANGELOG.md"                                                                                                                                               
:base=>"HISTORY.md"                                                                                                                                                                                     
:issues=>true                                                                                                                                                                                           
:add_issues_wo_labels=>true                                                                                                                                                                             
:add_pr_wo_labels=>true                                                                                                                                                                                 
:pulls=>true                                                                                                                                                                                            
:filter_issues_by_milestone=>true                                                                                                                                                                       
:author=>true                                                                                                                                                                                           
:unreleased=>true                                                                                                                                                                                       
:unreleased_label=>"Unreleased"                                                                                                                                                                         
:compare_link=>true                                                                                                                                                                                     
:exclude_labels=>["duplicate", "question", "invalid", "wontfix", "Duplicate", "Question", "Invalid", "Wontfix", "Meta: Exclude From Changelog"]                                                         
:summary_labels=>["Release summary", "release-summary", "Summary", "summary"]                                                                                                                           
:breaking_labels=>["backwards-incompatible", "Backwards incompatible", "breaking"]                                                                                                                      
:enhancement_labels=>["enhancement", "Enhancement", "Type: Enhancement"]                                                                                                                                
:bug_labels=>["bug", "Bug", "Type: Bug"]                                                                                                                                                                
:deprecated_labels=>["deprecated", "Deprecated", "Type: Deprecated"]                                                                                                                                    
:removed_labels=>["removed", "Removed", "Type: Removed"]                                                                                                                                                
:security_labels=>["security", "Security", "Type: Security"]                                                                                                                                            
:configure_sections=>{}                                                                                                                                                                                 
:add_sections=>{}                                                                                                                                                                                       
:issue_line_labels=>[]                                                                                                                                                                                  
:max_issues=>nil                                                                                                                                                                                        
:simple_list=>false                                                                                                                                                                                     
:ssl_ca_file=>nil                                                                                                                                                                                       
:verbose=>true                                                                                                                                                                                          
:header=>"# Changelog"                                                                                                                                                                                  
:merge_prefix=>"**Merged pull requests:**"                                                                                                                                                              
:issue_prefix=>"**Closed issues:**"                                                                                                                                                                     
:summary_prefix=>""                                                                                                                                                                                     
:breaking_prefix=>"**Breaking changes:**"                                                                                                                                                               
:enhancement_prefix=>"**Implemented enhancements:**"                                                                                                                                                    
:bug_prefix=>"**Fixed bugs:**"                                                                                                                                                                          
:deprecated_prefix=>"**Deprecated:**"                                                                                                                                                                   
:removed_prefix=>"**Removed:**"                                                                                                                                                                         
:security_prefix=>"**Security fixes:**"                                                                                                                                                                 
:http_cache=>true                                                                                                                                                                                       
:require=>[]                                                                                                                                                                                            
:token=>"hidden value" 
:user=>"fvwmorg"
:project=>"fvwm3"

This output seems to be the same when running via heinrichreimer/action-github-changelog-generator, and hence in the Github Actions YAML file:

  changelog:                                                                                                                                                                                            
      name: Update Changelog                                                                                                                                                                            
      runs-on: ubuntu-20.04                                                                                                                                                                             
      needs: build                                                                                                                                                                                      
      steps:                                                                                                                                                                                            
          - name: Checkout code                                                                                                                                                                         
            if: github.ref == 'refs/heads/master'                                                                                                                                                       
            uses: actions/checkout@v2                                                                                                                                                                   
            with:                                                                                                                                                                                       
                ref: master                                                                                                                                                                             
          - name: Update CHANGELOG                                                                                                                                                                      
            if: github.ref == 'refs/heads/master'
            uses: heinrichreimer/github-changelog-generator-action@v2.1.1
            with:
                token: ${{ secrets.GITHUB_TOKEN }} 
                issues: true
                issuesWoLabels: false
                pullRequests: true
                prWoLabels: true
                author: true
                unreleased: true
                stripGeneratorNotice: true
                verbose: true
                compareLink: true
                httpCache: true
                filterByMilestone: true
          - name: Commit CHANGELOG
            if: github.ref == 'refs/heads/master'
            uses: stefanzweifel/git-auto-commit-action@v4
            with:
                commit_user_name: Fvwm Automation
                commit_user_email: fvwm-automation@example.org
                commit_author: Fvwm Automation <fvwm-automation@example.org>
                commit_message: '[AUTO]: update CHANGELOG'
                file_pattern: CHANGELOG.md

Yet, despite the above working, there is still a clear difference in that heinrichreimer/action-github-changelog-generator is not including the same information as running the Docker command mentioned earlier. I can see that the Dockerfile in this repo is looking at the ferrarimarco/github-changelog-generator image -- so why there's a clear discrepancy here is unclear.

Thanks!

heinrichreimer commented 2 years ago

I'm not really sure why in your case pull requests are not included. This action just passes the --pull-requests flag to the Docker image: https://github.com/heinrichreimer/action-github-changelog-generator/blob/d8ed93bdfc7ada9e33167e8ae79f9d7f6b8909cf/action.yml#L46-L48 https://github.com/heinrichreimer/action-github-changelog-generator/blob/d8ed93bdfc7ada9e33167e8ae79f9d7f6b8909cf/entrypoint.sh#L43 Can you confirm that the issue can be reproduced when specifying the flag in the Docker command?

heinrichreimer commented 2 years ago

Also this might possibly be related to #23. Would you be so kind to check if the issue persists in v2.3?