forked from open-telemetry/opentelemetry-collector-contrib
-
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.
[chore] add a gh action that automatically tidies (open-telemetry#21902)
This will run when PRs with the label "dependencies" are added. In the short term, I'm leaving both dependabot and renovatebot on. Ideally, after seeing renovatebot run this week, we may be able to turn off dependabot for dependencies. --------- Signed-off-by: Alex Boten <[email protected]> Co-authored-by: Antoine Toulme <[email protected]>
- Loading branch information
Showing
2 changed files
with
48 additions
and
2 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,43 @@ | ||
name: "Project: Tidy" | ||
on: | ||
pull_request: | ||
types: [labeled] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
setup-environment: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.label.name == 'dependencies' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
cache: false | ||
- name: Cache Go | ||
id: go-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/bin | ||
~/go/pkg/mod | ||
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | ||
- name: Install dependencies | ||
if: steps.go-cache.outputs.cache-hit != 'true' | ||
run: make -j2 gomoddownload | ||
- name: Install Tools | ||
if: steps.go-cache.outputs.cache-hit != 'true' | ||
run: make install-tools | ||
- name: go mod tidy | ||
run: | | ||
make gotidy | ||
git config user.name opentelemetrybot | ||
git config user.email [email protected] | ||
echo "git diff --exit-code || (git add . && git commit -m \"go mod tidy\" && git push)" | ||
git diff --exit-code || (git add . && git commit -m "go mod tidy" && git push) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} |
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