Skip to content

Commit df00965

Browse files
authored
Update PR-powershell-preview.yml
1 parent 8afc045 commit df00965

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/PR-powershell-preview.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,39 @@ env:
2626
HOMEBREW_NO_INSTALL_CLEANUP: 1
2727

2828
jobs:
29+
changes:
30+
if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell'
31+
name: Change Detection
32+
runs-on: ubuntu-latest
33+
# Required permissions
34+
permissions:
35+
pull-requests: read
36+
# Set job outputs to values from filter step
37+
outputs:
38+
source: ${{ steps.filter.outputs.workflows }}
39+
steps:
40+
- name: checkout
41+
uses: actions/checkout@v4
42+
43+
# For pull requests it's not necessary to checkout the code
44+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0
45+
id: filter
46+
with:
47+
list-files: json
48+
filters: |
49+
workflows:
50+
- '.github/workflows/PR-powershell-lts.yml'
51+
- 'Formula/powershell-lts.rb'
52+
53+
- name: Capture outputs
54+
run: |
55+
"workflows: ${{ steps.filter.outputs.workflows }}"
56+
shell: pwsh
57+
2958
homebrew-formula-preview:
3059
timeout-minutes: 15
60+
needs: changes
61+
if: ${{ needs.changes.outputs.workflows == 'true' }}
3162
runs-on: macos-latest
3263
steps:
3364
- name: Checkout
@@ -49,3 +80,13 @@ jobs:
4980
- name: Install and Test Formula
5081
if: steps.filter.outputs.workflows == 'true'
5182
uses: ./.github/workflows/composite/installAndTest
83+
84+
ready_to_merge:
85+
name: Preview ready to merge
86+
needs:
87+
- homebrew-formula-preview
88+
- changes
89+
if: always()
90+
uses: PowerShell/compliance/.github/workflows/[email protected]
91+
with:
92+
needs_context: ${{ toJson(needs) }}

0 commit comments

Comments
 (0)