-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
46 lines (45 loc) · 1.73 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
45
46
name: "semrel-analyze"
description: "Analyzes conventional commits in repo to suggest next semantic version and tag relative to the last version tag"
inputs:
package:
description: "The name of the package in the mono-repo (git repo)"
required: true
directory:
description: "The path to the package.json in the mono-repo (e.g. libs/eventually)"
required: true
outputs:
last-tag:
description: "Last version tag found for input package"
value: ${{ steps.analyze.outputs.last-tag }}
next-tag:
description: "Next suggested version tag based on the conventional commits found since last tag or - when nothing found"
value: ${{ steps.analyze.outputs.next-tag }}
next-version:
description: "Next suggested semantic version based on the conventional commits found since last tag or - when nothing found"
value: ${{ steps.analyze.outputs.next-version }}
change-log:
description: "Log of conventional commits analyzed since last tag"
value: ${{ steps.analyze.outputs.change-log }}
runs:
using: "composite"
steps:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 22
- name: analyze ${{ inputs.package }}
id: analyze
shell: bash
env:
npm_config_yes: true
PACKAGE: ${{ inputs.package }}
DIRECTORY: ${{ inputs.directory }}
GITURL: "${{ github.server_url }}/${{ github.repository }}"
run: |
npx zx $GITHUB_ACTION_PATH/analyze.mjs | tail -4 | (
read -r l1; read -r l2; read -r l3; read -r l4;
echo "last-tag=$l1" >> $GITHUB_OUTPUT
echo "next-tag=$l2" >> $GITHUB_OUTPUT
echo "next-version=$l3" >> $GITHUB_OUTPUT
echo "change-log=$l4" >> $GITHUB_OUTPUT
)