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

Generated git_remote step fails to execute successfully #395

Closed
1 task
mbialon opened this issue Jan 19, 2024 · 1 comment · Fixed by #397
Closed
1 task

Generated git_remote step fails to execute successfully #395

mbialon opened this issue Jan 19, 2024 · 1 comment · Fixed by #397
Labels
bug Something isn't working

Comments

@mbialon
Copy link
Contributor

mbialon commented Jan 19, 2024

Description

PR #394 introduced a change to git_remote step generation.

Before

node ./scripts/should-release.js && ${previousCommand} || ${cancelCommand}

After

node ./scripts/should-release.js && $(${previousCommand}) || ${cancelCommand}

Adding the command substitution renders the step command like the following:

node ./scripts/should-release.js && $(echo "latest_commit=$(git ls-remote origin -h refs/heads/main | cut -f1)" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT) || echo "latest_commit=release_cancelled" >> $GITHUB_OUTPUT

And causes an error during workflow execution

/home/runner/work/_temp/e98cc669-1cb4-43aa-94ab-451c2068410d.sh: line 1: latest_commit=efeb476f67f8e94f7777df33ce6896f1c4f4c4a9: command not found

Versions

@cdktf/provider-project: 0.5.15

Providers

No response

Gist

No response

Possible Solutions

I believe replacing the command substitution with a subshell invocation should fix it.

node ./scripts/should-release.js && (${previousCommand}) || ${cancelCommand}

Workarounds

No response

Anything Else?

No response

References

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
Copy link

I'm going to lock this issue because it has been closed for at least 7 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue so we can investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant