Skip to content

Commit

Permalink
Accesses readarray for macOS using bash
Browse files Browse the repository at this point in the history
  • Loading branch information
holm10 committed Jan 10, 2025
1 parent d2f4e15 commit 88a9aa5
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/wheeltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
- name: Checks out repo
uses: actions/checkout@v4

- name: Set tags env variables.
- name: Set UBUNTU tags env variables.
if: matrix.os == 'ubuntu-latest'
run: |
# Set "checking" variable to false by default.
echo "has_tags=false" >> $GITHUB_ENV
Expand All @@ -34,6 +35,30 @@ jobs:
echo "spec_tags=${commit_message[1]}" >> $GITHUB_ENV
fi
- name: Set macOS tags env variables.
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 "#".
readarray -d "#" -t commit_message <<< "$text"
# Sanity check.
echo "the tags are: ${commit_message[1]}"
# Add tags and overwrite "checking" variable to true if there are tags.
if [[ "${commit_message[1]}" == *"@"* ]]; then
echo "has_tags=true" >> $GITHUB_ENV
echo "spec_tags=${commit_message[1]}" >> $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')
run: |
Expand Down

0 comments on commit 88a9aa5

Please sign in to comment.