if-none 0.0.5

Early break/continue/return if an optional expression evaluates to `None`.
Documentation
# SPDX-FileCopyrightText: The if-none authors
# SPDX-License-Identifier: CC0-1.0

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: pre-commit

permissions:
  contents: read

on:
  pull_request:
  push:
    branches:
      - "*"

env:
  CARGO_TERM_COLOR: always

jobs:
  pre-commit:
    name: Detecting code style issues
    runs-on: ubuntu-latest
    steps:
      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.x"

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal
          components: rustfmt, clippy

      - name: Check out repository
        uses: actions/checkout@v3

      - name: Cache Rust toolchain and build artifacts
        uses: Swatinem/rust-cache@v2

      - name: Generate Cargo.lock
        uses: actions-rs/cargo@v1
        with:
          command: generate-lockfile

      - name: Detect code style issues (push)
        uses: pre-commit/action@v3.0.0
        if: github.event_name == 'push'

      - name: Detect code style issues (pull_request)
        uses: pre-commit/action@v3.0.0
        if: github.event_name == 'pull_request'
        env:
          SKIP: no-commit-to-branch