[eas-cli] fix interpolated workflow URI validation - #4329
Open
davidmokos wants to merge 1 commit into
Open
Conversation
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4329 +/- ##
==========================================
+ Coverage 65.48% 65.51% +0.04%
==========================================
Files 1060 1060
Lines 49302 49305 +3
Branches 10437 10438 +1
==========================================
+ Hits 32282 32299 +17
+ Misses 16904 16890 -14
Partials 116 116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Slack workflow can read its webhook URL from an environment variable:
EAS CLI checks the workflow before it sends it to Expo's server. At that point, the environment variable has not been replaced with its real value. The local URL checker sees
${{ env.SLACK_WEBHOOK_URL }}instead of a URL and rejects the workflow.Expo's server already accepts this workflow. The SDK does not validate Slack webhook URLs, so the bug is in EAS CLI's local check.
The EAS Workflows skill once had its own validator with the same problem. expo/skills#149 removed it and changed the skill to use
eas workflow:validate. This PR fixes the check in EAS CLI instead of adding the validator back to the skill.How
When a URI field contains
${{ ... }}, EAS CLI now waits for the workflow to resolve that value at runtime instead of trying to validate the unfinished URL.Literal values still need to be valid URLs. For example,
webhook_url: not a URLstill fails validation. Other workflow and metadata checks do not change.Fixes ENG-26025
Test Plan
${{ env.SLACK_WEBHOOK_URL }}.