Skip to content

Commit

Permalink
Add update-deps workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon committed Dec 17, 2023
1 parent 72e3ede commit 0468a6a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/update-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: 'Update Dependencies'
on:
workflow_dispatch:
schedule:
# every Monday
- cron: '0 0 * * 1'
env:
GOPROXY: https://proxy.golang.org
permissions:
contents: read
jobs:
update-deps:
if: ${{ github.repository == 'kubernetes/cloud-provider-aws' }}
runs-on: ubuntu-20.04
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: '1.21.5'
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Update Dependencies
id: update_deps
run: |
make update-deps
echo 'changes<<EOF' >> $GITHUB_OUTPUT
git status --porcelain >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Create PR
if: ${{ steps.update_deps.outputs.changes != '' }}
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
with:
title: 'Update dependencies'
commit-message: Update dependencies
committer: github-actions <actions@github.com>
author: github-actions <actions@github.com>
branch: dependencies/update
branch-suffix: timestamp
base: master
delete-branch: true
labels: |
ok-to-test
release-note-none
body: |
Updating go.mod with latest dependencies.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ vet:
update-fmt:
./hack/update-gofmt.sh

.PHONY: update-deps
update-deps:
./hack/update-deps.sh

.PHONY: docs
docs:
./hack/build-gitbooks.sh
Expand Down
22 changes: 22 additions & 0 deletions hack/update-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o pipefail

go get $( go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -mod=mod -m all)
go mod tidy
$(cd tests/e2e && go mod tidy)

0 comments on commit 0468a6a

Please sign in to comment.