-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/unsafe-service
- Loading branch information
Showing
5 changed files
with
41 additions
and
148 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,41 @@ | ||
name: 👋 Friendly Reminders | ||
|
||
on: | ||
pull_request: | ||
branches: main | ||
|
||
jobs: | ||
job: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Extract go version | ||
id: go-version | ||
run: | | ||
echo "go-version=$(go work edit --json | jq -r '.Go')" >>$GITHUB_OUTPUT | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.go-version.outputs.go-version }} | ||
|
||
- name: Check Go Mod Tidy | ||
id: go-mod-tidy | ||
run: | | ||
# iterate over work file, cd and run go mod tidy | ||
for line in $(go work edit --json | jq -r '.Use.[].DiskPath'); do | ||
(cd $line && go mod tidy) | ||
done | ||
# check if any changes were made | ||
echo $(git status --porcelain) >> $GITHUB_OUTPUT | ||
- name: Post comment if go.mod was changed | ||
if: steps.go-mod-tidy.outputs.stdout != '' | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: '👋 Friendly reminder: go.mod was changed. Make sure to run `go mod tidy`!\n\n' + | ||
'```\n${{ steps.go-mod-tidy.outputs.stdout }}\n```' | ||
}) |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.