Skip to content

introduces change detection job and a "ready to merge" running on Linux to avoid macOS runner congestion #61

introduces change detection job and a "ready to merge" running on Linux to avoid macOS runner congestion

introduces change detection job and a "ready to merge" running on Linux to avoid macOS runner congestion #61

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
name: PowerShell LTS PR
permissions: read-all
on:
push:
paths:
- '.github/workflows/PR-powershell-lts.yml'
- 'Formula/powershell-lts.rb'
branches:
- master
pull_request:
defaults:
run:
shell: pwsh
env:
FORMULA_PATH: ./Formula/powershell-lts.rb
UPDATE_SCRIPT_PATH: ./scripts/Upgrade-Formula.ps1
FORMULA_NAME: powershell-lts
CHANNEL_NAME: lts
HOMEBREW_NO_ENV_HINTS: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
jobs:
changes:
if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell'
name: Change Detection
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
source: ${{ steps.filter.outputs.workflows }}
steps:
- name: checkout
uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0
id: filter
with:
list-files: json
filters: |
workflows:
- '.github/workflows/PR-powershell-lts.yml'
- 'Formula/powershell-lts.rb'
- name: Capture outputs
run: |
"workflows: ${{ steps.filter.outputs.workflows }}"
shell: pwsh
homebrew-formula-lts:
timeout-minutes: 15
needs: changes
if: ${{ needs.changes.outputs.workflows == 'true' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Agent
uses: ./.github/workflows/composite/prep
- name: Install and Test Formula
uses: ./.github/workflows/composite/installAndTest
ready_to_merge:
name: LTS ready to merge
needs:
- homebrew-formula-lts
- changes
if: always()
uses: PowerShell/compliance/.github/workflows/[email protected]
with:
needs_context: ${{ toJson(needs) }}