Skip to content

Commit 8ea3e38

Browse files
committed
ci: add license check workflow
1 parent d050ce7 commit 8ea3e38

3 files changed

Lines changed: 81 additions & 880 deletions

File tree

.github/workflows/ci-license.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Check license updates
2+
3+
on:
4+
workflow_call:
5+
# Make this a reusable workflow, no value needed
6+
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
7+
8+
env:
9+
TURBO_TELEMETRY_DISABLED: 1
10+
11+
jobs:
12+
license-check:
13+
name: License Check
14+
runs-on: 'ubuntu-latest'
15+
steps:
16+
- name: 👷 Checkout
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
19+
- name: 🛠️ Setup workspace
20+
uses: ./.github/actions/setup-workspace
21+
with:
22+
node-version: '20'
23+
24+
- name: ⬇️ Download Build Archive
25+
uses: ./.github/actions/download-archive
26+
with:
27+
name: vscode-webdriverio
28+
path: .
29+
filename: vscode-webdriverio-build.zip
30+
31+
- name: 📃 Generate License file
32+
run: pnpm --filter @vscode-wdio/compiler build -p vscode-webdriverio -l
33+
shell: bash
34+
35+
- name: ✅ Check status
36+
id: check
37+
run: |
38+
if [[ $(git status --short | grep -c -v vscode-webdriverio-build.zip) -ne 0 ]]; then
39+
STATUS=$(git status --verbose); printf "%s" "$STATUS"; git diff | cat
40+
echo "result=1" >> $GITHUB_OUTPUT
41+
else
42+
echo "result=0" >> $GITHUB_OUTPUT
43+
fi
44+
shell: bash
45+
46+
- uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2.9.1
47+
if: ${{ steps.check.outputs.result > 0 }}
48+
with:
49+
GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}
50+
header: license-error
51+
message: >
52+
Thank you for creating PR!🙏
53+
54+
It is likely that the license file needs to be updated due to changes in dependencies.
55+
56+
Please run following commands at project root directory.
57+
```
58+
$ pnpm run build
59+
60+
$ git add packages/vscode-webdriverio/LICENSE.md
61+
62+
$ git commit
63+
```
64+
65+
If you have any questions please reach out to us on our [Discord](https://discord.webdriver.io/)
66+
channel. We are happy to help you out there.
67+
68+
- uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2.9.1
69+
if: ${{ steps.check.outputs.result == 0 }}
70+
with:
71+
GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}
72+
header: license-error
73+
delete: true

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ jobs:
2929
needs: [lint, build]
3030
uses: ./.github/workflows/ci-typecheck.yml
3131

32+
license-check:
33+
name: License Check
34+
needs: [lint, build]
35+
uses: ./.github/workflows/ci-license.yml
36+
3237
unit:
3338
name: Unit
3439
needs: [lint, build]
@@ -48,21 +53,21 @@ jobs:
4853

4954
smoke-config:
5055
name: Smoke - Update Config
51-
needs: [lint, build, e2e]
56+
needs: [lint, build, unit, license-check, typecheck, e2e]
5257
uses: ./.github/workflows/ci-smoke.yml
5358
with:
5459
scenario: 'config'
5560

5661
smoke-timeout:
5762
name: Smoke - Worker idle timeout
58-
needs: [lint, build, e2e]
63+
needs: [lint, build, unit, license-check, typecheck, e2e]
5964
uses: ./.github/workflows/ci-smoke.yml
6065
with:
6166
scenario: 'timeout'
6267

6368
smoke-env:
6469
name: Smoke - Load .env files
65-
needs: [lint, build, e2e]
70+
needs: [lint, build, unit, license-check, typecheck, e2e]
6671
uses: ./.github/workflows/ci-smoke.yml
6772
with:
6873
scenario: 'env'

0 commit comments

Comments
 (0)