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

fix: Github CI example fails with single quote #2979

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

McPatate
Copy link

Description:

I am proposing a fix for the CI example in the README.

When someone commits a message containing a ', the CI will error given the raw JSON is simply enclosed with single quotes:

jq length <<< '${{ toJson(github.event.commits) }}'

cf huggingface/huggingface.js#754 for more context

Checklist:

  • [ ] Tests passing (make test-community)?
  • [ ] Lint passing (make lint this requires golangci-lint)?

@McPatate McPatate requested a review from a team as a code owner June 17, 2024 09:48
@CLAassistant
Copy link

CLAassistant commented Jun 17, 2024

CLA assistant check
All committers have signed the CLA.

@dustin-decker
Copy link
Contributor

What about this? Seems cleaner to not have a temp file or the Env: part of the config:

depth=$(($(jq length <<< "${{ toJson(github.event.commits) }}") + 2))
echo "depth=$depth" >> $GITHUB_ENV

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

Successfully merging this pull request may close these issues.

3 participants