Skip to content

another test

another test #9

name: React on each commit expect with prefix
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Getting the sources"
uses: actions/checkout@v4
- name: Check for prefix in commit messages
id: check_prefix
run: |
set -e # Enable exit on error
trap 'echo "An error occurred. Handling it."; exit 0' ERR
PREFIX="prefix"
git log --format=%B -n 1 $GITHUB_SHA | grep -q "^$PREFIX"
echo "prefix_found=0" >> $GITHUB_OUTPUT
if git log --format=%B -n 1 $GITHUB_SHA | grep -q "^$PREFIX"; then
echo "prefix_found=1" >> $GITHUB_OUTPUT
else
echo "prefix_found=0" >> $GITHUB_OUTPUT
fi
- name: Build and Test
if: steps.check_prefix.outputs.prefix_found == '1'
run: |
echo "work!"