File tree Expand file tree Collapse file tree 5 files changed +45
-44
lines changed Expand file tree Collapse file tree 5 files changed +45
-44
lines changed Original file line number Diff line number Diff line change 22
33on :
44 workflow_run :
5- workflows : ["Core CI"]
5+ workflows :
6+ - CI
67 types :
78 - completed
89
Original file line number Diff line number Diff line change 1- name : Core CI
1+ name : CI
22
33on :
4- workflow_dispatch : {}
54 push :
65 branches :
76 - main
8- pull_request :
7+ pull_request_target :
8+ types :
9+ - opened
10+ - synchronize
911 branches :
1012 - main
1113
1214
1315jobs :
1416 commit-lint :
15- if : ${{ github.event_name == 'pull_request ' }}
17+ if : ${{ github.event_name == 'pull_request_target ' }}
1618 uses : ./.github/workflows/commitlint.yml
1719 lint :
1820 uses : ./.github/workflows/lint.yml
Original file line number Diff line number Diff line change 11name : Commit Lint
22
33on :
4- workflow_call :
4+ workflow_call
55
66jobs :
7- commit-lint :
7+ commitlint :
88 runs-on : ubuntu-latest
9+
910 steps :
10- - name : Checkout
11- uses : actions/checkout@v2
11+ - uses : actions/checkout@v3
1212 with :
1313 fetch-depth : 0
1414
15- - name : Lint commits
16- uses : wagoid/commitlint-github-action@v3
15+ - uses : actions/setup-node@v3
16+ with :
17+ node-version : 22
1718
18- - name : Block fixup commits
19- if : ${{ github.event_name != 'merge_group' }}
20- uses : 13rac1/block-fixup-merge-action@v2.0.0
19+ - name : Install Git
20+ run : |
21+ if ! command -v git &> /dev/null; then
22+ echo "Git is not installed. Installing..."
23+ sudo apt-get update
24+ sudo apt-get install -y git
25+ else
26+ echo "Git is already installed."
27+ fi
2128
22- - name : Block Merge Commits
23- if : ${{ github.event_name != 'merge_group' }}
24- uses : Morishiri/block-merge-commits-action@v1.0.1
25- with :
26- repo-token : ${{ secrets.GITHUB_TOKEN }}
29+ - name : Install commitlint
30+ run : |
31+ npm install conventional-changelog-conventionalcommits
32+ npm install commitlint@latest
33+ npm install @commitlint/config-conventional
34+
35+ - name : Configure
36+ run : |
37+ echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
38+
39+ - name : Validate PR commits with commitlint
40+ run : npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Original file line number Diff line number Diff line change 1- name : Reusable Lint Workflow
1+ name : Lint
22
33on :
4- workflow_call :
5- inputs :
6- should_skip :
7- description : ' Whether to skip the linting step'
8- required : false
9- type : boolean
10- default : false
4+ workflow_call
115
126jobs :
137 lint :
148 name : Lint
15- runs-on : " ubuntu-24.04"
16- if : inputs.should_skip == false
17-
9+ runs-on : ubuntu-latest
1810
1911 steps :
2012 - uses : actions/checkout@v4
@@ -30,15 +22,15 @@ jobs:
3022 uv venv
3123 uv sync --all-extras
3224
33- - name : " Check static types"
25+ - name : Check static types
3426 run : |
3527 uv run mypy --config-file pyproject.toml .
3628
3729 - name : " Check linting"
3830 run : |
3931 uv run ruff check .
4032
41- - name : " Check formatting"
33+ - name : Check formatting
4234 run : |
4335 uv run ruff format --check .
4436
Original file line number Diff line number Diff line change 1- name : Reusable Test Workflow
1+ name : Test
22
33on :
44 workflow_call :
99 required : true
1010 UIPATH_CLIENT_SECRET :
1111 required : true
12- inputs :
13- should_skip :
14- description : ' Whether to skip the linting step'
15- required : false
16- type : boolean
17- default : false
1812
1913jobs :
2014 test :
2115 name : Test
22- runs-on : " ubuntu-24.04"
23- if : inputs.should_skip == false
16+ runs-on : ubuntu-latest
2417
2518 steps :
2619 - uses : actions/checkout@v4
@@ -31,16 +24,15 @@ jobs:
3124 with :
3225 python-version-file : " .python-version"
3326
34- - name : " Setup venv"
27+ - name : Setup venv
3528 run : |
3629 uv venv
3730 uv sync --all-extras
3831
39- - name : " Run tests"
32+ - name : Run tests
4033 run : |
4134 uv run pytest
4235 env :
4336 UIPATH_URL : ${{ secrets.UIPATH_URL }}
4437 UIPATH_CLIENT_ID : ${{ secrets.UIPATH_CLIENT_ID }}
4538 UIPATH_CLIENT_SECRET : ${{ secrets.UIPATH_CLIENT_SECRET }}
46-
You can’t perform that action at this time.
0 commit comments