|
| 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 |
0 commit comments