Skip to content

Commit 4203af8

Browse files
authored
feat: Add initial action and test workflow (#5)
Signed-off-by: Roger Barker <pendletonroger@gmail.com>
1 parent f4b5d28 commit 4203af8

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Git-Semver Setup Action'
2+
description: 'Performs setup of psanetra/git-semver for use in other GitHub workflows'
3+
author: 'Roger Barker <pendletonroger@gmail.com>'
4+
5+
inputs:
6+
version:
7+
description: 'The version of git-semver to use'
8+
required: false
9+
default: 'latest'
10+
11+
runs:
12+
using: 'composite'
13+
steps:
14+
- name: Install go
15+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
16+
with:
17+
go-version: '1.23.5'
18+
19+
- name: Clone and build git-semver
20+
shell: bash
21+
run: |
22+
if [[ "${{ inputs.version }}" == "latest" ]]; then
23+
# clone the latest version
24+
git clone https://github.com/PSanetra/git-semver.git
25+
else
26+
# clone the specified version
27+
git clone --branch ${{ inputs.version }} https://github.com/PSanetra/git-semver.git
28+
fi
29+
30+
cd git-semver/cli
31+
go build -o git-semver
32+
sudo mv git-semver /usr/local/bin
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Test Git-Semver Tool
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
fetch-depth: '0'
25+
26+
- name: Setup git-semver
27+
uses: ./.github/actions/git-semver-setup
28+
with:
29+
version: 'latest'
30+
31+
- name: Test git-semver
32+
run: |
33+
git-semver

.github/workflows/validate-conventional-commits.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
pull_request:
55

66
permissions:
7-
contents: write
7+
contents: read
8+
pull-requests: write
9+
issues: write
810

911
defaults:
1012
run:
@@ -17,4 +19,4 @@ jobs:
1719
- name: PR Conventional Commit Validation
1820
uses: ytanikin/pr-conventional-commits@8267db1bacc237419f9ed0228bb9d94e94271a1d # v1.4.1
1921
with:
20-
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
22+
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'

0 commit comments

Comments
 (0)