Skip to content

Commit 22bf9c4

Browse files
authored
Ensure GHA jobs fail fast in scripts (#54142)
1 parent 215fe6e commit 22bf9c4

16 files changed

+97
-1
lines changed

.github/workflows/accept-baselines-fix-lints.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
permissions:
77
contents: read
88

9+
# Ensure scripts are run with pipefail. See:
10+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
11+
defaults:
12+
run:
13+
shell: bash
14+
915
jobs:
1016
build:
1117
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ on:
1313
permissions:
1414
contents: read
1515

16+
# Ensure scripts are run with pipefail. See:
17+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
18+
defaults:
19+
run:
20+
shell: bash
21+
1622
jobs:
1723
test:
1824
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ on:
2424
permissions:
2525
contents: read
2626

27+
# Ensure scripts are run with pipefail. See:
28+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
29+
defaults:
30+
run:
31+
shell: bash
32+
2733
jobs:
2834
CodeQL-Build:
2935
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest

.github/workflows/ensure-related-repos-run-crons.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
permissions:
1515
contents: read
1616

17+
# Ensure scripts are run with pipefail. See:
18+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
19+
defaults:
20+
run:
21+
shell: bash
22+
1723
jobs:
1824
build:
1925
runs-on: ubuntu-latest

.github/workflows/error-deltas-watchdog.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
permissions:
99
contents: read
1010

11+
# Ensure scripts are run with pipefail. See:
12+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
13+
defaults:
14+
run:
15+
shell: bash
16+
1117
jobs:
1218
check-for-recent:
1319
runs-on: ubuntu-latest
@@ -36,4 +42,4 @@ jobs:
3642
DATE=$(date --date="7 days ago" --iso-8601)
3743
gh issue list --repo microsoft/typescript --search "[ServerErrors][JavaScript] created:>=$DATE" --state all --json number --jq ".[].number" \
3844
| grep -qe "[0-9]" \
39-
|| gh issue create --repo ${{ github.repository }} --title "No JavaScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)."
45+
|| gh issue create --repo ${{ github.repository }} --title "No JavaScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)."

.github/workflows/new-release-branch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
permissions:
88
contents: read
99

10+
# Ensure scripts are run with pipefail. See:
11+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
12+
defaults:
13+
run:
14+
shell: bash
15+
1016
jobs:
1117
build:
1218
runs-on: ubuntu-latest

.github/workflows/nightly.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
permissions:
1212
contents: read
1313

14+
# Ensure scripts are run with pipefail. See:
15+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
16+
defaults:
17+
run:
18+
shell: bash
19+
1420
jobs:
1521
build:
1622
runs-on: ubuntu-latest

.github/workflows/release-branch-artifact.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
permissions:
99
contents: read
1010

11+
# Ensure scripts are run with pipefail. See:
12+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
13+
defaults:
14+
run:
15+
shell: bash
16+
1117
jobs:
1218
build:
1319
runs-on: ubuntu-latest

.github/workflows/rich-navigation.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ on:
1313
permissions:
1414
contents: read
1515

16+
# Ensure scripts are run with pipefail. See:
17+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
18+
defaults:
19+
run:
20+
shell: bash
21+
1622
jobs:
1723
richnav:
1824
runs-on: windows-latest

.github/workflows/scorecard.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ on:
1717
# Declare default permissions as read only.
1818
permissions: read-all
1919

20+
# Ensure scripts are run with pipefail. See:
21+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
22+
defaults:
23+
run:
24+
shell: bash
25+
2026
jobs:
2127
analysis:
2228
name: Scorecard analysis

0 commit comments

Comments
 (0)