diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fab8a56..12f3cb4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,9 +1,35 @@ name: main -on: [push, pull_request] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: + check-branch: + runs-on: ubuntu-latest + + timeout-minutes: 2 + concurrency: + group: ci-check-branch-${{ github.ref }} + cancel-in-progress: true + + steps: + - uses: actions/checkout@v3 + if: ${{ github.event_name == 'pull_request' }} + with: + fetch-depth: 0 + + - name: Check if the PR's branch is updated + if: ${{ github.event_name == 'pull_request' }} + uses: osl-incubator/gh-check-pr-is-updated@1.0.0 + with: + remote_branch: origin/main + pr_sha: ${{ github.event.pull_request.head.sha }} + tests: + needs: check-branch runs-on: ubuntu-latest timeout-minutes: 10 @@ -55,6 +81,7 @@ jobs: run: makim tests.smoke --verbose linter: + needs: check-branch runs-on: ubuntu-latest timeout-minutes: 10