File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,43 @@ inputs:
1414 extra_requirements :
1515 description : " Install extra dependencies"
1616 required : false
17+ cache :
18+ description : ' Cache commitizen installation, set to "true" to enable'
19+ required : false
20+ default : " false"
1721
1822runs :
1923 using : " composite"
2024 steps :
21- - uses : actions/setup-python@v6
2225 - id : set-vars
2326 shell : python
2427 env :
2528 COMMITIZEN_VERSION : ${{ inputs.version }}
29+ CACHE : ${{ inputs.cache }}
2630 run : |
2731 import os
32+
33+ # Set commitizen version
2834 commitizen_version = os.environ.get("COMMITIZEN_VERSION", "").strip()
2935 if commitizen_version == "latest":
3036 set_commitizen_version = ""
3137 else:
3238 set_commitizen_version = f"=={commitizen_version}"
39+
40+ # Set python cache
41+ cache = os.environ.get("CACHE", "")
42+ if cache == True or cache == "true":
43+ set_cache = "pip"
44+ else:
45+ set_cache = ""
46+
47+ # Write outputs
3348 with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
3449 fh.write(f"COMMITIZEN_VERSION={set_commitizen_version}\n")
50+ fh.write(f"PYTHON_CACHE={set_cache}\n")
51+ - uses : actions/setup-python@v6
52+ with :
53+ cache : ${{ steps.set-vars.outputs.PYTHON_CACHE }}
3554 - name : Install commitizen
3655 shell : bash
3756 env :
You can’t perform that action at this time.
0 commit comments