Skip to content

Commit c471edc

Browse files
author
Peter Bengtsson
authored
Skip indexing portion if a workflow_run was not successful (#49941)
1 parent cc95552 commit c471edc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/sync-search-elasticsearch.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
if (context.payload.workflow_run.conclusion === "success") {
5959
return ["en"]
6060
}
61-
throw new Error(`It was a workflow_run but not success ('${context.payload.workflow_run.conclusion}')`)
61+
console.warn(`NOTE! It was a workflow_run but not success ('${context.payload.workflow_run.conclusion}')`)
62+
console.warn("This means we're not going to index anything in the next dependent step.")
63+
return []
6264
}
6365
6466
if (context.eventName === "workflow_dispatch") {
@@ -95,7 +97,7 @@ jobs:
9597
updateElasticsearchIndexes:
9698
needs: figureOutMatrix
9799
name: Update indexes
98-
if: ${{ github.repository == 'github/docs-internal' }}
100+
if: ${{ github.repository == 'github/docs-internal' && needs.figureOutMatrix.outputs.matrix != '[]' }}
99101
runs-on: ubuntu-20.04-xl
100102
strategy:
101103
fail-fast: false

0 commit comments

Comments
 (0)