Testing commit parser #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test wheel file build | ||
on: [push, pull_request] | ||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} for Python ${{ matrix.pyver }} | ||
# if: github.event_name == 'pull_request' | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-14] | ||
pyver: [cp311] | ||
steps: | ||
- name: Set tags env variables. | ||
run: | | ||
# 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 | ||