diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 3fe55b153b..569a54339c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -9,7 +9,7 @@ on: jobs: backport: name: Backport - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # Only react to merged PRs for security reasons. # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. if: | diff --git a/.github/workflows/brakeman-analysis.yml b/.github/workflows/brakeman-analysis.yml index ff1a99f6b4..51e7b0bb0f 100644 --- a/.github/workflows/brakeman-analysis.yml +++ b/.github/workflows/brakeman-analysis.yml @@ -19,7 +19,7 @@ on: jobs: brakeman-scan: name: Brakeman Scan - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # Checkout the repository to the GitHub Actions runner - name: Checkout diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 2b584d182a..ec39e5353b 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -15,7 +15,7 @@ on: jobs: check_yarn_lock: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: Check yarn.lock steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: yarn_lock_changed: ${{ steps.changed-yarn-lock.outputs.any_changed }} build_javascript: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: Build JS packages needs: check_yarn_lock if: needs.check_yarn_lock.outputs.yarn_lock_changed == 'true' @@ -59,7 +59,7 @@ jobs: RSpec: needs: [check_yarn_lock, build_javascript] if: ${{ success('check_yarn_lock') && !failure('build_javascript') }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -160,10 +160,12 @@ jobs: if: failure() with: name: Screenshots - path: spec/dummy/tmp/screenshots + path: | + spec/dummy/tmp/capybara + spec/dummy/tmp/screenshots PushJavascript: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [check_yarn_lock, RSpec] if: github.event_name == 'pull_request' steps: @@ -195,7 +197,7 @@ jobs: branch: ${{ github.head_ref }} Jest: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: NODE_ENV: test steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a0721a2853..df5427a5f8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ concurrency: jobs: Standard: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 @@ -20,7 +20,7 @@ jobs: - name: Lint Ruby files run: bundle exec standardrb ESLint: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -40,7 +40,7 @@ jobs: - name: Lint code run: yarn eslint Prettier: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index acdc5bff94..1821afb177 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -6,7 +6,7 @@ on: jobs: stale: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/stale@v5 diff --git a/app/models/concerns/alchemy/picture_thumbnails.rb b/app/models/concerns/alchemy/picture_thumbnails.rb index ef3a234e81..aa4e907233 100644 --- a/app/models/concerns/alchemy/picture_thumbnails.rb +++ b/app/models/concerns/alchemy/picture_thumbnails.rb @@ -102,11 +102,10 @@ def image_cropper_settings # Show image cropping link for ingredient def allow_image_cropping? - settings[:crop] && picture && - picture.can_be_cropped_to?( - settings[:size], - settings[:upsample] - ) && !!picture.image_file + settings[:crop] && picture&.can_be_cropped_to?( + settings[:size], + settings[:upsample] + ) && !!picture.image_file end private