Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit701e6e1

Browse files
committed
Fixes
1 parent4added2 commit701e6e1

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

‎.github/workflows/deploy.yaml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
name:should-deploy
3434
runs-on:ubuntu-latest
3535
outputs:
36-
verdict:${{ steps.check.outputs.verdict }}
36+
verdict:${{ steps.check.outputs.verdict }}# DEPLOY or NOOP
3737
steps:
3838
-name:Harden Runner
3939
uses:step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a# v2.13.1
@@ -49,27 +49,27 @@ jobs:
4949
-name:CHECKOUT MAIN
5050
run:|
5151
set -euxo pipefail
52+
git fetch origin
5253
git checkout main
54+
git checkout origin/dean/releases-freeze -- scripts/should_deploy.sh
5355
5456
-name:Check if deploy is enabled
5557
id:check
5658
run:|
5759
set -euo pipefail
58-
verdict="false"
59-
if ./scripts/should_deploy.sh; then
60-
verdict="true"
61-
fi
60+
verdict="$(./scripts/should_deploy.sh)"
6261
echo "verdict=$verdict" >> "$GITHUB_OUTPUT"
6362
6463
deploy:
6564
name:"deploy"
6665
runs-on:ubuntu-latest
6766
timeout-minutes:30
6867
needs:should-deploy
69-
if:needs.should-deploy.outputs.verdict == 'true'
68+
if:needs.should-deploy.outputs.verdict == 'DEPLOY'
7069
permissions:
7170
contents:read
7271
id-token:write
72+
packages:write# to retag image as dogfood
7373
steps:
7474
-name:Harden Runner
7575
uses:step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a# v2.13.1
@@ -107,7 +107,7 @@ jobs:
107107
uses:fluxcd/flux2/action@6bf37f6a560fd84982d67f853162e4b3c2235edb# v2.6.4
108108
with:
109109
# Keep this and the github action up to date with the version of flux installed in dogfood cluster
110-
version:"2.6.4"
110+
version:"2.7.0"
111111

112112
-name:Get Cluster Credentials
113113
uses:google-github-actions/get-gke-credentials@3da1e46a907576cefaa90c484278bb5b259dd395# v3.0.0

‎scripts/should_deploy.sh‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env bash
22

33
# This script determines if a commit in either the main branch or a
4-
# `release/x.y` branch should be deployed to dogfood. Returns 0 if deploys are
5-
# enabled on this branch, 1 otherwise.
4+
# `release/x.y` branch should be deployed to dogfood.
5+
#
6+
# To avoid masking unrelated failures, this script will return 0 in either case,
7+
# and will print `DEPLOY` or `NOOP` to stdout.
68

79
set -euo pipefail
810
# shellcheck source=scripts/lib.sh
@@ -59,6 +61,8 @@ log "Deploy branch: $deploy_branch"
5961
log
6062
if [["$branch_name"!="$deploy_branch" ]];then
6163
log"VERDICT: DO NOT DEPLOY"
62-
exit 1
64+
echo"NOOP"# stdout
65+
else
66+
log"VERDICT: DEPLOY"
67+
echo"DEPLOY"# stdout
6368
fi
64-
log"VERDICT: DEPLOY"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp