-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add automation to update ko.yaml for csp updates (#1448)
Signed-off-by: Bob Callaway <[email protected]>
- Loading branch information
1 parent
e68e90b
commit 3fbd8df
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Cloud-SQL-Proxy update | ||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
my_job: | ||
runs-on: ubuntu-latest | ||
if: github.event.label.name == 'cloud-sql-proxy' | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: true | ||
|
||
- name: Update .ko.yaml with latest release version | ||
run: | | ||
export CLOUD_SQL_PROXY_VERSION="$(awk -F'[:@]' '/FROM gcr.io\/cloud-sql-connectors\/cloud-sql-proxy/{print $2; exit}' Dockerfile.deps)" | ||
echo "Detected cloud-sql-proxy ${CLOUD_SQL_PROXY_VERSION}..." | ||
sed -i 's/\(cloud-sql-proxy:\).*/\1'${CLOUD_SQL_PROXY_VERSION}'/' .ko.yaml | ||
- name: Amend Dependabot PR | ||
env: | ||
PULL_REQUEST_HEAD_REF: ${{ github.event.pull_request.head.ref }} | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add -A | ||
git commit -sam "Bumping cloud-sql-proxy version in .ko.yaml" | ||
git push origin HEAD:${PULL_REQUEST_HEAD_REF} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This Dockerfile simply serves as a trigger for dependabot to notify when a new upstream release of a component is available | ||
# | ||
# !!! READ AND ACT ON THIS !!! If dependabot proposes an update to the container listed below, you should also update the value listed in '.ko.yaml' and cut a new release of scaffolding | ||
FROM gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.15.0-alpine as cloud-sql-proxy | ||
# This will trigger a Dependabot update, which should trigger a workflow to update .ko.yaml accordingly | ||
FROM gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.15.0-alpine@sha256:7815b33cc48745133a065d32b5f420d6b2572565424d90cd8f4261d9529060f2 | ||
ENV FOO=BAR |