-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
44 lines (39 loc) · 1.27 KB
/
action.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
39
40
41
42
43
44
name: No Fixups
description: |
GitHub Action to use in pull requests to check if there are accidental
commits that should have been autosquashed first.
author: Matijs Brinkhuis
inputs:
skip-checkout:
description: |
Skip the actions/checkout because you are using your own checkout.
Set `fetch-depth` and `ref` yourself. See below for values.
default: 'false'
runs:
using: composite
steps:
- name: Check if this is a pull request
if: ${{ github.event_name != 'pull_request' }}
run: |
echo '### Error' >> ${GITHUB_STEP_SUMMARY}
echo '' >> ${GITHUB_STEP_SUMMARY}
echo 'This action can only be run on pull requests.' >> ${GITHUB_STEP_SUMMARY}
exit 1
shell: bash
- name: Checkout
if: ${{ inputs.skip-checkout == 'false' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set GitHub Action path
env:
ACTION_PATH: ${{ github.action_path }}
run: echo "${ACTION_PATH}" >> ${GITHUB_PATH}
shell: bash
- name: Check if there are 'amend!', 'fixup!', and 'squash!' commits
run: action.sh
shell: bash
branding:
icon: git-commit
color: red