-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Go get update | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- go.mod | ||
- go.sum | ||
schedule: | ||
- cron: 58 4 * * * | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
go-get-update: | ||
name: go get update | ||
|
||
runs-on: ubuntu-24.04 | ||
environment: autoupdates | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Go get update | ||
run: go get -u | ||
|
||
- name: Check for changes | ||
run: | | ||
if git diff --exit-code; then | ||
echo "changes=false" >> $GITHUB_ENV | ||
else | ||
echo "changes=true" >> $GITHUB_ENV | ||
fi | ||
- name: Commit and push to branch | ||
if: env.changes == 'true' | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
default_author: github_actions | ||
message: Automated go get update | ||
new_branch: update/go-get-update | ||
push: origin update/go-get-update --set-upstream --force | ||
|
||
- name: Create pull request | ||
if: env.changes == 'true' | ||
uses: devops-infra/action-pull-request@master | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
target_branch: main | ||
label: automated | ||
title: Automated go get update | ||
get_diff: true |
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,65 @@ | ||
name: Go mod tidy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- go.mod | ||
- go.sum | ||
schedule: | ||
- cron: 48 4 * * * | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
go-mod-tidy: | ||
name: go mod tidy | ||
|
||
runs-on: ubuntu-24.04 | ||
environment: autoupdates | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Go mod tidy | ||
run: go mod tidy | ||
|
||
- name: Check for changes | ||
run: | | ||
if git diff --exit-code; then | ||
echo "changes=false" >> $GITHUB_ENV | ||
else | ||
echo "changes=true" >> $GITHUB_ENV | ||
fi | ||
- name: Commit and push to branch | ||
if: env.changes == 'true' | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
default_author: github_actions | ||
message: Automated go mod tidy | ||
new_branch: update/go-mod-tidy | ||
push: origin update/go-mod-tidy --set-upstream --force | ||
|
||
- name: Create pull request | ||
if: env.changes == 'true' | ||
uses: devops-infra/action-pull-request@master | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
target_branch: main | ||
label: automated | ||
title: Automated go mod tidy | ||
get_diff: true |
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
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