Skip to content

Commit

Permalink
Switch to using awk for macOS
Browse files Browse the repository at this point in the history
Testing # @does @it @work?
  • Loading branch information
holm10 committed Jan 10, 2025
1 parent 0103bd3 commit bbe2169
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/wheeltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,19 @@ jobs:
if: (matrix.os == 'macos-13') || (matrix.os == 'macos-14')
run: |
# Get updated bash to access readarray
brew install bash
# Switch to bash for readarray
$(brew --prefix bash)/bin/bash
# Set "checking" variable to false by default.
echo "has_tags=false" >> $GITHUB_ENV
# Get your last commit message, not the merge commit.
text=$(git log -1 --no-merges --pretty=%B)
# Read the commit message into an array split by "#".
IFS="#" read -rA commit_message <<< "$text"
declare commit_args=$(awk 'NR==2' <<< $(awk -F'#' '{ for(i=1;i<=NF;i++) print $i }' <<< $(echo $text|tr -d '\n')))
# Sanity check.
echo "the tags are: ${commit_message[1]}"
echo "the tags are: ${commit_args}"
# Add tags and overwrite "checking" variable to true if there are tags.
if [[ "${commit_message[1]}" == *"@"* ]]; then
if [[ "${commit_args[1]}" == *"@"* ]]; then
echo "has_tags=true" >> $GITHUB_ENV
echo "spec_tags=${commit_message[1]}" >> $GITHUB_ENV
echo "spec_tags=${commit_args}" >> $GITHUB_ENV
fi
# Switch back to zsh
/bin/zsh
- name: Set up macOS-specific paths and libraries
if: (matrix.os == 'macos-13') || (matrix.os == 'macos-14')
Expand Down

0 comments on commit bbe2169

Please sign in to comment.