diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ef17f2df33..4af1b330a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -366,3 +366,21 @@ jobs: with: run: cargo codspeed run token: ${{ secrets.CODSPEED_TOKEN }} + + tmp: + runs-on: ubuntu-latest + steps: + - name: "Checkout Branch" + uses: actions/checkout@v4 + with: + ref: 0c030b5bf31e425cb6070db7386243eca6dbd8f1 + - name: Check main branch + if: 0c030b5bf31e425cb6070db7386243eca6dbd8f1 + run: | + # Fetch the main branch since a shallow checkout is used by default + git fetch origin main --unshallow + git branch --contains 0c030b5bf31e425cb6070db7386243eca6dbd8f1 + if ! git branch --contains 0c030b5bf31e425cb6070db7386243eca6dbd8f1 | grep -E '(^|\s)main$'; then + echo "The specified sha is not on the main branch" >&2 + exit 1 + fi