diff --git a/.github/actions/run-check-version/action.yaml b/.github/actions/run-check-version/action.yaml new file mode 100644 index 000000000..f48e7b73c --- /dev/null +++ b/.github/actions/run-check-version/action.yaml @@ -0,0 +1,19 @@ +name: "Check SDK versions match" +description: | + Run check-version to ensure versions match when the target branch is main + +runs: + using: composite + steps: + # Install node and pnpm. + - uses: actions/setup-node@v3 + with: + node-version-file: .node-version + registry-url: "https://registry.npmjs.org" + - uses: pnpm/action-setup@v2 + with: + version: 8.9.0 + + # Run version check + - run: pnpm check-version + shell: bash diff --git a/.github/actions/run-lint/action.yaml b/.github/actions/run-lint/action.yaml index 14373891e..14da27d80 100644 --- a/.github/actions/run-lint/action.yaml +++ b/.github/actions/run-lint/action.yaml @@ -17,7 +17,3 @@ runs: # Run eslint - run: pnpm install --frozen-lockfile && pnpm lint shell: bash - - # Run version check - - run: pnpm check-version - shell: bash diff --git a/.github/workflows/run-check-version.yaml b/.github/workflows/run-check-version.yaml new file mode 100644 index 000000000..47547f5e1 --- /dev/null +++ b/.github/workflows/run-check-version.yaml @@ -0,0 +1,20 @@ +env: + GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + +name: "Check SDK versions match" +on: + pull_request: + branches: [main] + types: [labeled, opened, synchronize, reopened, auto_merge_enabled] + push: + branches: + - main + +jobs: + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ env.GIT_SHA }} + - uses: ./.github/actions/run-check-version