42
42
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
43
43
with :
44
44
fetch-depth : 1
45
- # For pull requests it's not necessary to checkout the code
45
+ persist-credentials : false
46
46
- name : check changed files
47
47
uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
48
48
id : filter
@@ -111,7 +111,9 @@ jobs:
111
111
112
112
- id : debug
113
113
run : |
114
- echo "${{ toJSON(steps.filter )}}"
114
+ echo "$FILTER_JSON"
115
+ env :
116
+ FILTER_JSON : ${{ toJSON(steps.filter.outputs) }}
115
117
116
118
# Disabled due to instability. See: https://github.com/coder/coder/issues/14553
117
119
# Re-enable once the flake hash calculation is stable.
@@ -162,6 +164,7 @@ jobs:
162
164
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
163
165
with :
164
166
fetch-depth : 1
167
+ persist-credentials : false
165
168
166
169
- name : Setup Node
167
170
uses : ./.github/actions/setup-node
@@ -234,6 +237,7 @@ jobs:
234
237
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
235
238
with :
236
239
fetch-depth : 1
240
+ persist-credentials : false
237
241
238
242
- name : Setup Node
239
243
uses : ./.github/actions/setup-node
@@ -289,6 +293,7 @@ jobs:
289
293
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
290
294
with :
291
295
fetch-depth : 1
296
+ persist-credentials : false
292
297
293
298
- name : Setup Node
294
299
uses : ./.github/actions/setup-node
@@ -353,12 +358,13 @@ jobs:
353
358
# a separate repository to allow its use before actions/checkout.
354
359
- name : Setup RAM Disks
355
360
if : runner.os == 'Windows'
356
- uses : coder/setup-ramdisk-action@e1100847ab2d7bcd9d14bcda8f2d1b0f07b36f1b
361
+ uses : coder/setup-ramdisk-action@e1100847ab2d7bcd9d14bcda8f2d1b0f07b36f1b # v0.1.0
357
362
358
363
- name : Checkout
359
364
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
360
365
with :
361
366
fetch-depth : 1
367
+ persist-credentials : false
362
368
363
369
- name : Setup Go Paths
364
370
id : go-paths
@@ -421,34 +427,34 @@ jobs:
421
427
set -o errexit
422
428
set -o pipefail
423
429
424
- if [ "${{ runner.os }} " == "Windows" ]; then
430
+ if [ "$RUNNER_OS " == "Windows" ]; then
425
431
# Create a temp dir on the R: ramdisk drive for Windows. The default
426
432
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
427
433
mkdir -p "R:/temp/embedded-pg"
428
434
go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg" -cache "${EMBEDDED_PG_CACHE_DIR}"
429
- elif [ "${{ runner.os }} " == "macOS" ]; then
435
+ elif [ "$RUNNER_OS " == "macOS" ]; then
430
436
# Postgres runs faster on a ramdisk on macOS too
431
437
mkdir -p /tmp/tmpfs
432
438
sudo mount_tmpfs -o noowners -s 8g /tmp/tmpfs
433
439
go run scripts/embedded-pg/main.go -path /tmp/tmpfs/embedded-pg -cache "${EMBEDDED_PG_CACHE_DIR}"
434
- elif [ "${{ runner.os }} " == "Linux" ]; then
440
+ elif [ "$RUNNER_OS " == "Linux" ]; then
435
441
make test-postgres-docker
436
442
fi
437
443
438
444
# if macOS, install google-chrome for scaletests
439
445
# As another concern, should we really have this kind of external dependency
440
446
# requirement on standard CI?
441
- if [ "${{ matrix.os } }" == "macos-latest" ]; then
447
+ if [ "${RUNNER_OS }" == "macos-latest" ]; then
442
448
brew install google-chrome
443
449
fi
444
450
445
451
# macOS will output "The default interactive shell is now zsh"
446
452
# intermittently in CI...
447
- if [ "${{ matrix.os } }" == "macos-latest" ]; then
453
+ if [ "${RUNNER_OS }" == "macos-latest" ]; then
448
454
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
449
455
fi
450
456
451
- if [ "${{ runner.os } }" == "Windows" ]; then
457
+ if [ "${RUNNER_OS }" == "Windows" ]; then
452
458
# Our Windows runners have 16 cores.
453
459
# On Windows Postgres chokes up when we have 16x16=256 tests
454
460
# running in parallel, and dbtestutil.NewDB starts to take more than
@@ -458,15 +464,15 @@ jobs:
458
464
NUM_PARALLEL_TESTS=16
459
465
# Only the CLI and Agent are officially supported on Windows and the rest are too flaky
460
466
PACKAGES="./cli/... ./enterprise/cli/... ./agent/..."
461
- elif [ "${{ runner.os } }" == "macOS" ]; then
467
+ elif [ "${RUNNER_OS }" == "macOS" ]; then
462
468
# Our macOS runners have 8 cores. We set NUM_PARALLEL_TESTS to 16
463
469
# because the tests complete faster and Postgres doesn't choke. It seems
464
470
# that macOS's tmpfs is faster than the one on Windows.
465
471
NUM_PARALLEL_PACKAGES=8
466
472
NUM_PARALLEL_TESTS=16
467
473
# Only the CLI and Agent are officially supported on macOS and the rest are too flaky
468
474
PACKAGES="./cli/... ./enterprise/cli/... ./agent/..."
469
- elif [ "${{ runner.os } }" == "Linux" ]; then
475
+ elif [ "${RUNNER_OS }" == "Linux" ]; then
470
476
# Our Linux runners have 8 cores.
471
477
NUM_PARALLEL_PACKAGES=8
472
478
NUM_PARALLEL_TESTS=8
@@ -475,7 +481,7 @@ jobs:
475
481
476
482
# by default, run tests with cache
477
483
TESTCOUNT=""
478
- if [ "${{ github.ref } }" == "refs/heads/main" ]; then
484
+ if [ "${GITHUB_REF }" == "refs/heads/main" ]; then
479
485
# on main, run tests without cache
480
486
TESTCOUNT="-count=1"
481
487
fi
@@ -546,6 +552,7 @@ jobs:
546
552
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
547
553
with :
548
554
fetch-depth : 1
555
+ persist-credentials : false
549
556
550
557
- name : Setup Go
551
558
uses : ./.github/actions/setup-go
@@ -594,6 +601,7 @@ jobs:
594
601
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
595
602
with :
596
603
fetch-depth : 1
604
+ persist-credentials : false
597
605
598
606
- name : Setup Go
599
607
uses : ./.github/actions/setup-go
@@ -653,6 +661,7 @@ jobs:
653
661
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
654
662
with :
655
663
fetch-depth : 1
664
+ persist-credentials : false
656
665
657
666
- name : Setup Go
658
667
uses : ./.github/actions/setup-go
@@ -679,6 +688,7 @@ jobs:
679
688
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
680
689
with :
681
690
fetch-depth : 1
691
+ persist-credentials : false
682
692
683
693
- name : Setup Node
684
694
uses : ./.github/actions/setup-node
@@ -711,6 +721,7 @@ jobs:
711
721
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
712
722
with :
713
723
fetch-depth : 1
724
+ persist-credentials : false
714
725
715
726
- name : Setup Node
716
727
uses : ./.github/actions/setup-node
@@ -785,6 +796,7 @@ jobs:
785
796
fetch-depth : 0
786
797
# 👇 Tells the checkout which commit hash to reference
787
798
ref : ${{ github.event.pull_request.head.ref }}
799
+ persist-credentials : false
788
800
789
801
- name : Setup Node
790
802
uses : ./.github/actions/setup-node
@@ -863,6 +875,7 @@ jobs:
863
875
with :
864
876
# 0 is required here for version.sh to work.
865
877
fetch-depth : 0
878
+ persist-credentials : false
866
879
867
880
- name : Setup Node
868
881
uses : ./.github/actions/setup-node
@@ -926,7 +939,7 @@ jobs:
926
939
egress-policy : audit
927
940
928
941
- name : Ensure required checks
929
- run : |
942
+ run : | # zizmor: ignore[template-injection] We're just reading needs.x.result here, no risk of injection
930
943
echo "Checking required checks"
931
944
echo "- fmt: ${{ needs.fmt.result }}"
932
945
echo "- lint: ${{ needs.lint.result }}"
@@ -959,6 +972,7 @@ jobs:
959
972
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
960
973
with :
961
974
fetch-depth : 0
975
+ persist-credentials : false
962
976
963
977
- name : Setup build tools
964
978
run : |
@@ -1059,6 +1073,7 @@ jobs:
1059
1073
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1060
1074
with :
1061
1075
fetch-depth : 0
1076
+ persist-credentials : false
1062
1077
1063
1078
- name : GHCR Login
1064
1079
uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
@@ -1201,7 +1216,7 @@ jobs:
1201
1216
make build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
1202
1217
1203
1218
# only push if we are on main branch
1204
- if [ "${{ github.ref } }" == "refs/heads/main" ]; then
1219
+ if [ "${GITHUB_REF }" == "refs/heads/main" ]; then
1205
1220
# build and push multi-arch manifest, this depends on the other images
1206
1221
# being pushed so will automatically push them
1207
1222
# note: omitting the -j argument to avoid race conditions when pushing
@@ -1228,12 +1243,13 @@ jobs:
1228
1243
continue-on-error : true
1229
1244
env :
1230
1245
COSIGN_EXPERIMENTAL : 1
1246
+ BUILD_TAG : ${{ steps.build-docker.outputs.tag }}
1231
1247
run : |
1232
1248
set -euxo pipefail
1233
1249
1234
1250
# Define image base and tags
1235
1251
IMAGE_BASE="ghcr.io/coder/coder-preview"
1236
- TAGS=("${{ steps.build-docker.outputs.tag } }" "main" "latest")
1252
+ TAGS=("${BUILD_TAG }" "main" "latest")
1237
1253
1238
1254
# Generate and attest SBOM for each tag
1239
1255
for tag in "${TAGS[@]}"; do
@@ -1372,7 +1388,7 @@ jobs:
1372
1388
# Report attestation failures but don't fail the workflow
1373
1389
- name : Check attestation status
1374
1390
if : github.ref == 'refs/heads/main'
1375
- run : |
1391
+ run : | # zizmor: ignore[template-injection] We're just reading steps.attest_x.outcome here, no risk of injection
1376
1392
if [[ "${{ steps.attest_main.outcome }}" == "failure" ]]; then
1377
1393
echo "::warning::GitHub attestation for main tag failed"
1378
1394
fi
@@ -1432,6 +1448,7 @@ jobs:
1432
1448
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1433
1449
with :
1434
1450
fetch-depth : 0
1451
+ persist-credentials : false
1435
1452
1436
1453
- name : Authenticate to Google Cloud
1437
1454
uses : google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5 # v2.1.12
@@ -1496,6 +1513,7 @@ jobs:
1496
1513
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1497
1514
with :
1498
1515
fetch-depth : 0
1516
+ persist-credentials : false
1499
1517
1500
1518
- name : Setup flyctl
1501
1519
uses : superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # v1.5
@@ -1531,7 +1549,7 @@ jobs:
1531
1549
uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1532
1550
with :
1533
1551
fetch-depth : 1
1534
- # We need golang to run the migration main.go
1552
+ persist-credentials : false
1535
1553
- name : Setup Go
1536
1554
uses : ./.github/actions/setup-go
1537
1555
@@ -1550,7 +1568,7 @@ jobs:
1550
1568
1551
1569
steps :
1552
1570
- name : Send Slack notification
1553
- run : |
1571
+ run : | # zizmor: ignore[template-injection] We're reading variables from github context into a json string, so replacing with envs is tricky
1554
1572
curl -X POST -H 'Content-type: application/json' \
1555
1573
--data '{
1556
1574
"blocks": [
0 commit comments