diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a4ece033..d33ee940 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,13 +1,9 @@ name: CI on: - push: + pull_request: branches: - main - - release-* - tags: - - '*.*.*' - pull_request: jobs: check: @@ -20,7 +16,14 @@ jobs: name: check - (${{ matrix.platform }}) runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v3 + - name: 'PR commits + 1' + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" + + - name: 'Checkout PR branch and PR commits' + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} # Ruby rules use host install still: https://github.com/bazelruby/rules_ruby/issues/112 - name: Setup Ruby