From 9da6c2f70c15f2dc3c8f776a9e596e1726fe1ad9 Mon Sep 17 00:00:00 2001 From: frank zhu Date: Fri, 15 Mar 2024 08:33:21 -0700 Subject: [PATCH] update changeset ci check with contracts (#12448) --- .github/workflows/changeset.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/changeset.yml b/.github/workflows/changeset.yml index f077cee1285..8b881e18d23 100644 --- a/.github/workflows/changeset.yml +++ b/.github/workflows/changeset.yml @@ -34,21 +34,39 @@ jobs: - '!core/**/*.json' - '!core/chainlink.goreleaser.Dockerfile' - '!core/chainlink.Dockerfile' + contracts: + - contracts/**/*.sol core-changeset: - added: '.changeset/**' + contracts-changeset: + - added: 'contracts/.changeset/**' - name: Make a comment uses: unsplash/comment-on-pr@ffe8f97ccc63ce12c3c23c6885b169db67958d3b # v1.3.0 if: ${{ (steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true') && steps.files-changed.outputs.core-changeset == 'false' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - msg: "I see you updated files related to core. Please run `pnpm changeset` to add a changeset." + msg: "I see you updated files related to `core`. Please run `pnpm changeset` in the root directory to add a changeset." check_for_duplicate_msg: true - - name: Check for new changeset + - name: Make a comment + uses: unsplash/comment-on-pr@ffe8f97ccc63ce12c3c23c6885b169db67958d3b # v1.3.0 + if: ${{ steps.files-changed.outputs.contracts == 'true' && steps.files-changed.outputs.contracts-changeset == 'false' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: "I see you updated files related to `contracts`. Please run `pnpm changeset` in the `contracts` directory to add a changeset." + check_for_duplicate_msg: true + - name: Check for new changeset for core if: ${{ (steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true') && steps.files-changed.outputs.core-changeset == 'false' }} shell: bash run: | - echo "Please run pnpm changeset to add a changeset." + echo "Please run pnpm changeset to add a changeset for core." + exit 1 + - name: Check for new changeset for contracts + if: ${{ steps.files-changed.outputs.contracts == 'true' && steps.files-changed.outputs.contracts-changeset == 'false' }} + shell: bash + run: | + echo "Please run pnpm changeset to add a changeset for contracts." exit 1 - name: Collect Metrics if: always()