-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update all golang dependencies weekly
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "update all golang dependencies" | ||
on: | ||
schedule: # Monday morning: https://crontab.guru/#0_6_*_*_1 | ||
- cron: "0 6 * * 1" | ||
workflow_dispatch: {} | ||
jobs: | ||
make-go-get-u: | ||
name: "go get -u" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/cloudfoundry/app-autoscaler-release-tools:main | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- name: make go-get-u and make package-specs | ||
shell: bash | ||
run: | | ||
#! /usr/bin/env bash | ||
set -eu -o pipefail | ||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | ||
git switch --force-create scheduled-dependency-update-with-go-get-u origin/main | ||
make go-get-u package-specs | ||
declare -i -r num_changed_files="$(git status --porcelain | wc --lines)" | ||
if ((num_changed_files > 0)) | ||
then | ||
echo 'Changes to some files were necessary!' | ||
git add . | ||
git commit --message="Automated dependency update with go get -u" --message="Please check that no unwanted changes have been introduced." | ||
git push | ||
gh pr create --fill --label dependencies | ||
else | ||
echo 'No files changed!' | ||
fi | ||
echo '🏁' |
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