Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Issues with orhun/git-cliff-action after upgrade from v3.3.0 to the latest v4 #29

Closed
dbelyaev opened this issue Aug 29, 2024 · 11 comments · Fixed by #30
Closed

Issues with orhun/git-cliff-action after upgrade from v3.3.0 to the latest v4 #29

dbelyaev opened this issue Aug 29, 2024 · 11 comments · Fixed by #30

Comments

@dbelyaev
Copy link

dbelyaev commented Aug 29, 2024

I switched from v3 to v4 and now fails with (output from act tool):

Run Main Download git-cliff
🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/git-cliff-composite-0.sh] user= workdir=
| /var/run/act/workflow/git-cliff-composite-0.sh: line 2: /var/run/act/actions/[email protected]/install.sh: Permission denied
@dbelyaev dbelyaev changed the title v4 fails witrh v4 fails with 'install.sh permission denied' Aug 29, 2024
@dbelyaev dbelyaev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
@orhun
Copy link
Owner

orhun commented Aug 29, 2024

Hey, v4 no longer uses Docker for this action. You can use the docker image directly if you wish to keep using it :)

As for act, I'm not sure what's going on there. Can you share a minimal reproducible example?

@dbelyaev
Copy link
Author

Hi, @orhun, and thank you for your quick response!

I have created a simple repository with an example of issues that arise after upgrading from v3.3.0 to v4.
You can find the demo repository here: dbelyaev/gitcliff-demo.

This repository includes a simple workflow called cd-release-draft.yml that runs on a push to the main branch and does the following:

  1. It tries to find an upcoming release version based on merge commit message and outputs it for other steps (example: v0.0.1)
    https://github.com/dbelyaev/gitcliff-demo/blob/84de18176f5fbf7e08bd270f05d88660fa4b2b2c/.github/workflows/cd-release-draft.yml#L18-L27

  2. It calls the orhun/git-cliff-action action to generate a changelog.
    https://github.com/dbelyaev/gitcliff-demo/blob/84de18176f5fbf7e08bd270f05d88660fa4b2b2c/.github/workflows/cd-release-draft.yml#L30-L53

  3. It tries to create a new draft for GitHub release using the changelog generated by the generate-changelog step (git-cliff).
    https://github.com/dbelyaev/gitcliff-demo/blob/84de18176f5fbf7e08bd270f05d88660fa4b2b2c/.github/workflows/cd-release-draft.yml#L56-L76

Initial release/v0.0.1 run (using orhun/[email protected]) went as planned resulting in nice changelog and github release.

The second release/v0.0.2 run (using orhun/[email protected]) tried to generate changelog but failed to generate changelog resulting in an empty release.

Here is an output of action run gitcliff v4.

Let me know if you have any further questions or concerns.

@dbelyaev dbelyaev reopened this Aug 30, 2024
@dbelyaev dbelyaev changed the title v4 fails with 'install.sh permission denied' Issues with orhun/git-cliff-action after upgrade from v3.3.0 to the latest v4 Aug 30, 2024
@dbelyaev
Copy link
Author

UPDATE.
I was suspicious that maybe experimental GitHub integration feature is the cause of the problem, so I removed:

--github-repo ${{ github.repository }}

And did another run and it is still failing to generate changelog.

Some output:

+ LOCATION=https://github.com/orhun/git-cliff/releases/download/v2.5.0/git-cliff-2.5.0-x86_64-unknown-linux-gnu.tar.gz
+ [[ ! -e git-cliff-2.5.0-x86_64-unknown-linux-gnu.tar.gz ]]
+ curl --silent --show-error --fail --location --output git-cliff-2.5.0-x86_64-unknown-linux-gnu.tar.gz https://github.com/orhun/git-cliff/releases/download/v2.5.0/git-cliff-2.5.0-x86_64-unknown-linux-gnu.tar.gz
+ tar -xf git-cliff-2.5.0-x86_64-unknown-linux-gnu.tar.gz
+ mv git-cliff-2.5.0/git-cliff .
Run /home/runner/work/_actions/orhun/git-cliff-action/8720f565e14eb8f89de1c1399d3a5f75027957ff/run.sh --config=cliff.toml --verbose \ --unreleased \ --tag v0.0.3
+ set -o noglob
++ stat -c %u:%g .
+ owner=1001:127
++ id -u
+ chown -R 1001 .
+ OUTPUT=git-cliff/CHANGELOG.md
++ dirname git-cliff/CHANGELOG.md
+ mkdir -p git-cliff
mkdir: cannot create directory ‘git-cliff’: File exists
++ echo --config=cliff.toml --verbose ' --unreleased' ' --tag' v0.0.3
++ xargs
+ args='--config=cliff.toml --verbose --unreleased --tag v0.0.3'
+ GIT_CLIFF_OUTPUT=git-cliff/CHANGELOG.md
+ ./git-cliff --config=cliff.toml --verbose --unreleased --tag v0.0.3
 DEBUG git_cliff > No GitHub remote is set, using remote: dbelyaev/gitcliff-demo
 DEBUG git_cliff_core::changelog > Adding remote data...
 DEBUG git_cliff_core::changelog > Processing the commits...
 DEBUG git_cliff_core::changelog > Processing the releases...
 ERROR git_cliff                 > IO error: `Not a directory (os error 20)`
+ exit_code=1
++ mktemp
+ CONTEXT=/tmp/tmp.k5OrYfEyFq
+ GIT_CLIFF_OUTPUT=/tmp/tmp.k5OrYfEyFq
+ ./git-cliff --config=cliff.toml --verbose --unreleased --tag v0.0.3 --context
 DEBUG git_cliff > No GitHub remote is set, using remote: dbelyaev/gitcliff-demo
 DEBUG git_cliff_core::changelog > Adding remote data...
 DEBUG git_cliff_core::changelog > Processing the commits...
 DEBUG git_cliff_core::changelog > Processing the releases...
+ cat git-cliff/CHANGELOG.md
cat: git-cliff/CHANGELOG.md: Not a directory
+ chown -R 1001:127 .
+ echo 'content<<EOF'
+ cat git-cliff/CHANGELOG.md
cat: git-cliff/CHANGELOG.md: Not a directory
+ echo EOF
+ echo changelog=git-cliff/CHANGELOG.md
++ jq -r '.[0].version' /tmp/tmp.k5OrYfEyFq
+ echo version=v0.0.3
+ echo exit_code=1

@orhun
Copy link
Owner

orhun commented Sep 1, 2024

Thanks for the detailed debugging of the issue!

I see a couple of errors in the logs:

2024-08-30T07:51:23.2261098Z ERROR git_cliff > IO error: Not a directory (os error 20)

My first suspicion is:

+ GIT_CLIFF_OUTPUT=git-cliff/CHANGELOG.md

Does that directory really exist? Can you try setting an explicit output file and try again?

@orhun
Copy link
Owner

orhun commented Sep 1, 2024

Also, cc @M0NsTeRRR since he implemented this new binary functionality :)

@orhun
Copy link
Owner

orhun commented Sep 1, 2024

One other error is:

ERROR git_cliff_core::remote > Request error: {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/pulls/pulls#list-pull-requests","status":"403"}
DEBUG git_cliff_core::remote > Error while fetching page: JsonError(Error("invalid type: map, expected a sequence", line: 1, column: 0))

Maybe there is also a permission issue? Can you try setting up some permissions in the workflow and try again maybe?

@M0NsTeRRR
Copy link
Contributor

Hello,

Thanks for the notification @orhun.

@dbelyaev could you test with github action m0nsterrr/[email protected] ?
The script could not create the git-cliff folder because a binary with the same name exists in the current directory.

@dbelyaev
Copy link
Author

dbelyaev commented Sep 2, 2024

@M0NsTeRRR
I just tested your suggested fix and it was able to generate a changelog! 👍

Test run for the m0nsterrr/[email protected]: here and generated changelog.

@M0NsTeRRR
Copy link
Contributor

Cool, @orhun I let you merge the PR :)

@orhun
Copy link
Owner

orhun commented Sep 2, 2024

Awesome, thanks for the quick fix! <3

@orhun orhun closed this as completed in #30 Sep 2, 2024
@orhun
Copy link
Owner

orhun commented Sep 2, 2024

v4/v4.0.1 is released, it should work fine now. @dbelyaev let me know if you experience any other issues!

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

Successfully merging a pull request may close this issue.

3 participants