-
Notifications
You must be signed in to change notification settings - Fork 101
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
Corrected a problem with the acceptance test action. #1583
Conversation
It seems the replacement for ::set-output (i.e. >> $GITHUB_OUTPUT) does not accept newlines in the data.
# Obtain the last commit from the branch to merge (hence the HEAD^2). | ||
# In case of multi-line commit messages, remove any \n, because the GITHUB_OUTPUT method | ||
# of sending data to other jobs does not like them. | ||
run: echo "pr_commit_message=\"$(git log --format=%B -n 1 HEAD^2 | tr '\n' ' '))\"" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried like this?
echo "pr_commit_message=$(git log --format=%B -n 1 HEAD | tr '\n' ' '))"
... because in terminal, it fails with the ^2
. And the extra "" are not necessary, I've confirmed this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HEAD^2 works for a merge. It takes the previous message from the branch that will be merged.
HEAD for a merge would be the merge message itself (Merge branch ... into ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't know that. J'va me coucher moins niaiseux ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the quotes.
✅ Rule acceptance tests passed. |
One last commit was not picked up. |
@jcpitre Do you mean this line?
Removing the double quotes? |
Check #1584 |
Approved it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - it solved the problem I met.
acceptance_test.yml did not run properly.
It seems the replacement for ::set-output (i.e. >> $GITHUB_OUTPUT) does not accept newlines in the data.
This was a problem with multi-line commit messages.
Just replaced newlines by spaces.