forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.15 KB
/
commit_message.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Skip tag checker
on:
workflow_call:
outputs:
message:
description: "Skip tag checker"
value: ${{ jobs.check_skip_tags.outputs.message }}
permissions:
contents: read
jobs:
check_skip_tags:
name: Check for skips
runs-on: ubuntu-latest
outputs:
message: ${{ steps.skip_check.outputs.message }}
steps:
- name: Checkout scipy
uses: actions/[email protected]
# Gets the correct commit message for pull request
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check for skips
id: skip_check
# the lint workflow is not currently skipped with [docs only].
# this could be changed by adding a new job which uses this workflow to lint.yml
# and changing the output here based on the combination of tags (if desired).
run: |
set -xe
COMMIT_MSG=$(git log --no-merges -1)
RUN="1"
if [[ "$COMMIT_MSG" == *"[lint only]"* || "$COMMIT_MSG" == *"[docs only]"* ]]; then
RUN="0"
fi
echo "message=$RUN" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}