Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
List of MorphoCloudWorkflow changes:

```
$ git shortlog a644d53..328e926 --no-merges
Jean-Christophe Fillion-Robin (1):
      fix(extract-issue-fields): Avoid evaluation of backticks as bash command
```

See MorphoCloud/MorphoCloudWorkflow@a644d53...328e926
  • Loading branch information
jcfr committed Dec 15, 2024
1 parent cdb9126 commit dbe169e
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/actions/extract-issue-fields/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,50 @@ runs:
- name: Display parsed data
shell: bash
run: |
echo ${{ toJSON(steps.parse.outputs.data) }} | jq .
cat <<'EOF' | jq .
${{ steps.parse.outputs.data }}
EOF
- name: Extract fields
id: extract
shell: bash
run: |
instance_flavor=$(echo ${{ toJSON(steps.parse.outputs.data) }} | \
jq -r '."cloud-computing-instance-flavor".text | split(" - ")[0]')
instance_flavor=$(
cat <<'EOF' | \
jq -r '."cloud-computing-instance-flavor".text | split(" - ")[0]'
${{ steps.parse.outputs.data }}
EOF
)
echo "instance_flavor [$instance_flavor]"
echo "instance_flavor=$instance_flavor" >> $GITHUB_OUTPUT
orcid=$(
echo ${{ toJSON(steps.parse.outputs.data) }} |
cat <<'EOF' | \
jq -r ".orcid.text"
${{ steps.parse.outputs.data }}
EOF
)
echo "orcid [$orcid]"
echo "orcid=$orcid" >> $GITHUB_OUTPUT
# Also strip "<" and ">" to convert from "<[email protected]>" to "[email protected]"
email=$(
echo ${{ toJSON(steps.parse.outputs.data) }} |
jq -r ".email.text" |
cat <<'EOF' | \
jq -r ".email.text" | \
sed -E 's/^<([^<>]+)>$/\1/'
${{ steps.parse.outputs.data }}
EOF
)
echo "email [$email]"
echo "email=$email" >> $GITHUB_OUTPUT
# Also strip "<" and ">" to convert from "<[email protected]>" to "[email protected]"
confirm_email=$(
echo ${{ toJSON(steps.parse.outputs.data) }} |
jq -r '."confirm-email".text // empty' |
cat <<'EOF' | \
jq -r '."confirm-email".text // empty' | \
sed -E 's/^<([^<>]+)>$/\1/'
${{ steps.parse.outputs.data }}
EOF
)
# If the "Confirm Email" field is missing (e.g., in older issues),
Expand All @@ -86,4 +100,5 @@ runs:
confirm_email="$email"
fi
echo "confirm_email [$confirm_email]"
echo "confirm_email=$confirm_email" >> $GITHUB_OUTPUT

0 comments on commit dbe169e

Please sign in to comment.