Skip to content

Commit 7c4933c

Browse files
Merge pull request #239 from docker/ci/fix-share-link-regex
fix: use variable for regex in share link validation
2 parents 4063002 + cee0f1f commit 7c4933c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/validation.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ jobs:
156156
REPOSITORY: ${{ needs.parse-issue.outputs.repository }}
157157
run: |
158158
share_link=$(docker extension share "$REPOSITORY")
159-
if [[ ! "$share_link" =~ ^https://[a-zA-Z0-9./?=_&%-]+$ ]]; then
159+
url_regex='^https://[a-zA-Z0-9./?=_&%-]+$'
160+
if [[ ! "$share_link" =~ $url_regex ]]; then
160161
echo "Unexpected share link format" >> "$GITHUB_STEP_SUMMARY"
161162
exit 1
162163
fi

0 commit comments

Comments
 (0)