-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
45 lines (40 loc) · 1.25 KB
/
action.yaml
File metadata and controls
45 lines (40 loc) · 1.25 KB
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
name: Setup commitizen CLI
description: Github action to only configure cz CLI
inputs:
version:
description: "Version of commitizen to install"
required: false
default: "latest"
extra_requirements:
description: "Install extra dependencies"
required: false
branding:
icon: "anchor"
color: "purple"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v6
- id: set-vars
shell: python
env:
COMMITIZEN_VERSION: ${{ inputs.version }}
CACHE: ${{ inputs.cache }}
run: |
import os
# Set commitizen version
commitizen_version = os.environ.get("COMMITIZEN_VERSION", "").strip()
if commitizen_version == "latest":
set_commitizen_version = ""
else:
set_commitizen_version = f"=={commitizen_version}"
# Write outputs
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
fh.write(f"COMMITIZEN_VERSION={set_commitizen_version}\n")
- name: Install commitizen
shell: bash
env:
COMMITIZEN_VERSION: ${{ steps.set-vars.outputs.COMMITIZEN_VERSION }}
EXTRA_REQUIREMENTS: ${{ inputs.extra_requirements }}
run: |
pip install -U commitizen${COMMITIZEN_VERSION} ${EXTRA_REQUIREMENTS}