Skip to content

Commit 229cfe9

Browse files
Copilotphlax
andauthored
Add should and status jobs to Publishing CI workflow (#3141)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: phlax <[email protected]>
1 parent f50eb2f commit 229cfe9

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/publishing.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,23 @@ concurrency:
1515

1616

1717
jobs:
18+
should:
19+
runs-on: ubuntu-24.04
20+
outputs:
21+
run: ${{ steps.filter.outputs.run }}
22+
steps:
23+
- uses: envoyproxy/toolshed/gh-actions/github/should-run@b78171200b6cf28afef2fd16c9015e8dba6e37cc
24+
id: filter
25+
with:
26+
config: |
27+
paths:
28+
- '.github/workflows/_publish.yml'
29+
- '.github/workflows/publishing.yml'
30+
1831
get-main:
1932
runs-on: ubuntu-24.04
33+
needs: should
34+
if: fromJSON(needs.should.outputs.run || 'false')
2035
outputs:
2136
message: ${{ steps.commit.outputs.message }}
2237
sha: ${{ steps.commit.outputs.sha }}
@@ -37,7 +52,10 @@ jobs:
3752
echo "Latest MESSAGE from main: $MESSAGE"
3853
3954
publish:
40-
needs: get-main
55+
needs:
56+
- should
57+
- get-main
58+
if: fromJSON(needs.should.outputs.run || 'false')
4159
permissions:
4260
actions: read
4361
uses: ./.github/workflows/_publish.yml
@@ -65,3 +83,21 @@ jobs:
6583
bins-version: 0.1.23
6684
- sha: ${{ github.event.pull_request.head.sha }}
6785
event: pull_request
86+
87+
status:
88+
runs-on: ubuntu-24.04
89+
if: >-
90+
always()
91+
&& github.event_name == 'pull_request'
92+
name: Publishing
93+
needs:
94+
- should
95+
- get-main
96+
- publish
97+
steps:
98+
- run: |
99+
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
100+
echo "One or more jobs failed or were cancelled"
101+
exit 1
102+
fi
103+
echo "All required jobs passed or were skipped"

0 commit comments

Comments
 (0)