-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 898 Bytes
/
test.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
name: Commit Verifier Action Test
on:
push:
branches:
- main
jobs:
verify-commit-job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Verify Commit Hash
uses: shiftEscape/commit-hash-verifier-action@main
with:
commit-hash: ${{ github.sha }}
branch-name: ${{ github.ref }}
# Exit on invalid commit hash
- name: Stop job if commit is invalid
if: steps.verify-commit.outputs.valid-commit == 'false'
shell: bash
run: exit 1
# Continue with other steps if commit is valid
- name: Continue with remaining steps
if: steps.verify-commit.outputs.valid-commit == 'true'
shell: bash
run: |
# Continue with your desired workflow logic here
echo "Commit hash is valid and from the correct branch"