Skip to content

Commit

Permalink
chore: update fitgen.yml (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
muktihari authored Mar 31, 2024
1 parent 83693ec commit 701e253
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/fitgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@ jobs:
env:
COMMENT: ${{ github.event.comment.body }} # Sanitize input using env to prevent script injection attack
run: |
echo "trigger=${{ startsWith($COMMENT, 'run fitgen') }}" >> $GITHUB_OUTPUT
if [[ "${{ startsWith($COMMENT, 'run fitgen') }}" == "false" ]]; then
echo "Aborted: no command found"
exit 0
fi
if [[ "${{ $COMMENT }}" =~ ^run\ fitgen\ ([0-9]+\.[0-9]+)$ ]]; then
if [[ "$COMMENT" =~ ^run\ fitgen\ ([0-9]+\.[0-9]+)$ ]]; then
echo "trigger=true" >> $GITHUB_OUTPUT
echo "profile_version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
else
echo "trigger=false" >> $GITHUB_OUTPUT
echo "Aborted: not a valid 'run fitgen <profile.version>' command"
exit 0
fi
Expand Down

0 comments on commit 701e253

Please sign in to comment.