Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update-deps workflow #789

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
author: github-actions <[email protected]>
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)
Loading