From 563c51d4311f1ff8b159355f8553905348d4b86a Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 3 Oct 2022 14:49:35 +0800 Subject: [PATCH] Get base sha from PR --- .github/workflows/lint-docs.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index 312de8b1c..d9f0ddae0 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -22,10 +22,22 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v5 + + - uses: nrwl/last-successful-commit-action@v1 + id: last_successful_commit_pull_request + with: + branch: ${{ steps.branch-name.outputs.base_ref_branch }} + workflow_id: 'lint-docs.yml' + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Check if source docs are changed id: changed-docs uses: tj-actions/changed-files@v29 with: + base_sha: ${{ steps.last_successful_commit_pull_request.outputs.commit_hash }} files: | packages/mermaid/src/docs/* packages/mermaid/src/docs.mts