softprops / action-gh-release

📦 :octocat: GitHub Action for creating GitHub Releases
MIT License
3.85k stars 434 forks source link

Fails with too many commits: "Argument list too long" #471

Open waltkb opened 1 week ago

waltkb commented 1 week ago

In our CI pipeline we recently saw an error surface with softprops/action-gh-release@v2, which seems to be related to the number of commits in the release.

From what I can see, the supplied changelog is evaluated thrice, and it seems to be ~950 commits (or at least lines in the debug output) when this randomly started to happen.

The error arises at this step:

- name: Create Release
  uses: softprops/action-gh-release@v2
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  with:
    tag_name: v${{ env.release_version }}
    body: |
      ${{ steps.changelog.outputs.changelog }}
    prerelease: ${{ steps.changelog.outputs.prerelease }}

With this being the debug log:

##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Create Release'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Create Release
##[debug]Loading inputs
##[debug]Evaluating: format('v{0}', env.release_version)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> 'v{0}'
##[debug]..Evaluating Index:
##[debug]....Evaluating env:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'release_version'
##[debug]..=> '1.0.2406261453-SNAPSHOT'
##[debug]=> 'v1.0.2406261453-SNAPSHOT'
##[debug]Result: 'v1.0.2406261453-SNAPSHOT'
##[debug]Evaluating: format('{0}
##[debug]', steps.changelog.outputs.changelog)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> '{0}
##[debug]'
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating steps:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'changelog'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'outputs'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'changelog'
##[debug]..=> '## New Features

...
lots of commits
...

##[debug]**Full Changelog**: https://github.com/<...>
##[debug]'
##[debug]Evaluating: steps.changelog.outputs.prerelease
##[debug]Evaluating Index:
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating steps:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'changelog'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'outputs'
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'prerelease'
##[debug]=> 'true'
##[debug]Result: 'true'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env

And then the error being thrown:

Error: An error occurred trying to start process '/home/runner/runners/2.317.0/externals/node20/bin/node' with working directory '/home/runner/work/***-identity/***-identity'. Argument list too long

This usually happens when too many command line arguments are provided, and could possibly be fixed by setting ulimit -S -s unlimited?

wiegell commented 6 days ago

see this: https://github.com/actions/runner/issues/1733#issuecomment-1069719149