diff --git a/.github/workflows/PR-powershell-daily.yml b/.github/workflows/PR-powershell-daily.yml index 48550fb7..bcd487c8 100644 --- a/.github/workflows/PR-powershell-daily.yml +++ b/.github/workflows/PR-powershell-daily.yml @@ -28,8 +28,39 @@ env: 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-daily: timeout-minutes: 15 + needs: changes + if: ${{ needs.changes.outputs.workflows == 'true' }} runs-on: macos-latest steps: - name: Checkout @@ -51,3 +82,13 @@ jobs: - name: Install and Test Formula if: steps.filter.outputs.workflows == 'true' uses: ./.github/workflows/composite/installAndTest + + ready_to_merge: + name: Daily ready to merge + needs: + - homebrew-formula-daily + - changes + if: always() + uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 + with: + needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/PR-powershell-lts.yml b/.github/workflows/PR-powershell-lts.yml index e5d954bc..c269bdf8 100644 --- a/.github/workflows/PR-powershell-lts.yml +++ b/.github/workflows/PR-powershell-lts.yml @@ -26,26 +26,56 @@ env: HOMEBREW_NO_INSTALL_CLEANUP: 1 jobs: - homebrew-formula-lts: - timeout-minutes: 15 - runs-on: macos-latest + 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 + - name: checkout uses: actions/checkout@v4 - - name: Check for applicable files - uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 + # 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 - if: steps.filter.outputs.workflows == 'true' uses: ./.github/workflows/composite/prep - name: Install and Test Formula - if: steps.filter.outputs.workflows == 'true' 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/ready-to-merge.yml@v1.0.0 + with: + needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/PR-powershell-preview.yml b/.github/workflows/PR-powershell-preview.yml index 22326bcb..da479964 100644 --- a/.github/workflows/PR-powershell-preview.yml +++ b/.github/workflows/PR-powershell-preview.yml @@ -26,8 +26,39 @@ env: 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-preview: timeout-minutes: 15 + needs: changes + if: ${{ needs.changes.outputs.workflows == 'true' }} runs-on: macos-latest steps: - name: Checkout @@ -49,3 +80,13 @@ jobs: - name: Install and Test Formula if: steps.filter.outputs.workflows == 'true' uses: ./.github/workflows/composite/installAndTest + + ready_to_merge: + name: Preview ready to merge + needs: + - homebrew-formula-preview + - changes + if: always() + uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 + with: + needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/PR-powershell.yml b/.github/workflows/PR-powershell.yml index d54b3f10..3260b860 100644 --- a/.github/workflows/PR-powershell.yml +++ b/.github/workflows/PR-powershell.yml @@ -28,8 +28,39 @@ env: 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-stable: timeout-minutes: 15 + needs: changes + if: ${{ needs.changes.outputs.workflows == 'true' }} runs-on: macos-latest steps: - name: Checkout @@ -60,3 +91,13 @@ jobs: - name: Install and Test Formula if: steps.filter.outputs.workflows == 'true' uses: ./.github/workflows/composite/installAndTest + + ready_to_merge: + name: Stable ready to merge + needs: + - homebrew-formula-stable + - changes + if: always() + uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 + with: + needs_context: ${{ toJson(needs) }}