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

Commit082fdec

Browse files
committed
Fixes
1 parent81ffde0 commit082fdec

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

‎.github/workflows/deploy.yaml‎

Lines changed: 6 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,28 +49,27 @@ jobs:
4949
-name:CHECKOUT MAIN
5050
run:|
5151
set -euxo pipefail
52+
git fetch origin
5253
git checkout main
5354
git checkout origin/dean/releases-freeze -- scripts/should_deploy.sh
5455
5556
-name:Check if deploy is enabled
5657
id:check
5758
run:|
5859
set -euo pipefail
59-
verdict="false"
60-
if ./scripts/should_deploy.sh; then
61-
verdict="true"
62-
fi
60+
verdict="$(./scripts/should_deploy.sh)"
6361
echo "verdict=$verdict" >> "$GITHUB_OUTPUT"
6462
6563
deploy:
6664
name:"deploy"
6765
runs-on:ubuntu-latest
6866
timeout-minutes:30
6967
needs:should-deploy
70-
if:needs.should-deploy.outputs.verdict == 'true'
68+
if:needs.should-deploy.outputs.verdict == 'DEPLOY'
7169
permissions:
7270
contents:read
7371
id-token:write
72+
packages:write# to retag image as dogfood
7473
steps:
7574
-name:Harden Runner
7675
uses:step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a# v2.13.1
@@ -108,7 +107,7 @@ jobs:
108107
uses:fluxcd/flux2/action@6bf37f6a560fd84982d67f853162e4b3c2235edb# v2.6.4
109108
with:
110109
# Keep this and the github action up to date with the version of flux installed in dogfood cluster
111-
version:"2.6.4"
110+
version:"2.7.0"
112111

113112
-name:Get Cluster Credentials
114113
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