Skip to content

fix: avoid using comment body directly #8851

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

Merged
merged 6 commits into from
Aug 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: do not use commnet_body directly
  • Loading branch information
matifali authored Aug 2, 2023
commit 1a5606e0d5642e09baa94429d643c20269c3e800
11 changes: 10 additions & 1 deletion .github/workflows/pr-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,16 @@ jobs:
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
experiments=${{ github.event.inputs.experiments }}
else
experiments=$(echo "${{ github.event.comment.body }}" | grep -oP '(?<=--experiments )[^ ]+')
comment_body=${{ github.event.comment.body }}
# extract experiments part
extracted_experiments=$(echo "$comment_body" | grep -oP '(?<=--experiments )[^ ]+')
# Validate that the experiments is a comma-separated list of alphanumeric strings, "*", or "-"
if [[ $extracted_experiments =~ ^[a-zA-Z0-9_*,\"-]+$ ]]; then
experiments=$extracted_experiments
else
echo "Invalid input: $extracted_experiments"
exit 1
fi
fi
echo "experiments=$experiments" >> $GITHUB_OUTPUT

Expand Down