-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Deploy-blockers can't be added if they include double-quotes. #3600
Comments
This will also fail if the issue title contains any single quotes |
It just needs text escaping which should escape every invalid and special char in bash. |
@roryabraham should this be external? i'm currently going down the list of unassigned orphaned issues |
Yep, thanks for the follow-up @jboniface! |
Triggered auto assignment to @jboniface ( |
Do you expect it to be purely in BASH or node script would be fine? |
pure bash would be cleaner if there's a reasonable way to do it. We don't want to have to create another GH Action just to escape a string. Another option would be to find a community action and use that. |
No need for action. We can directly run the node -e there or Node script.js as that is bash. I think that Node is available in PATH. |
I think you need to first run the |
Triggered auto assignment to @tgolen ( |
Proposal
This works for all chars except the single quote itself. To escape the single quote, close the quoting before it, insert the single quote, and re-open the quoting. Then as we have to escape the ` so that they can be substituted further. echo "DEPLOY_BLOCKER_TITLE=$(sed -e "s/'/'\\\\''/g; s/\`/\\\\\`/g; 1s/^/'/; \$s/\$/'/" <<< ${{ github.event.pull_request.title }})" >> $GITHUB_ENV Now we unescape it to get the normal string at https://github.com/Expensify/Expensify.cash/blob/9a23847aa430d30c093418b9b2c0511d61b6a243/.github/workflows/deployBlocker.yml#L57 TO text: '💥 New E.cash Deploy Blocker: <${{ env.DEPLOY_BLOCKER_URL }}|'+ `${{ env.DEPLOY_BLOCKER_TITLE }}`.replace(/(^'|'$)/gi, '').replace(/'\''/gi,'\'') + '>', This should work based on the assumption that custom_payload value is parsable which I believe it is. https://action-slack.netlify.app/with#custom_payload |
Heh, sounds good to me. It's a bit over my head, but sounds like you and Rory know what's going on here. 🟢 |
Hmmm I'm having a bit of difficulty understanding this proposal as well. Don't we also have to escape double-quotes? We can continue discussion in the PR. |
paid |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
DeployBlockerCash
workflow.Expected Result:
deployBlocker.yml
workflow should not fail.StagingDeployCash
checklist should be updated to include the new deploy blocker.Actual Result:
Workflow failures:
https://github.com/Expensify/Expensify.cash/runs/2833882293?check_suite_focus=true
https://github.com/Expensify/Expensify.cash/runs/2833925987?check_suite_focus=true
Workaround:
Add the deploy blocker to the
StagingDeployCash
manually.Platform:
Where is this issue occurring?
Github only
Version Number:
1.0.69-0
Notes/Photos/Videos: I think we just need to escape the string variable of special characters here
view this job on upwork
The text was updated successfully, but these errors were encountered: