name: Pull Request reviews
on:
  pull_request:
    branches: [ 2_0_X ]

jobs:
  pre-commit:
    permissions:
      contents: read
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - name: Docker login
        run: docker login docker.pkg.github.com -u $GITHUB_ACTOR -p $GITHUB_TOKEN
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
      - name: Run pre-commit hooks
        run: |
          docker run --privileged -t -v $GITHUB_WORKSPACE:/github/workspace docker.pkg.github.com/fwupd/fwupd/fwupd-precommit:latest

  snap:
    needs: pre-commit
    uses: ./.github/workflows/snap.yml
    with:
      deploy: false
    secrets: inherit

  matrix:
    needs: pre-commit
    uses: ./.github/workflows/matrix.yml
    with:
      publish: false
    secrets: inherit
