mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CI: Add Dependabot go workspace action (#96064)
This commit is contained in:
parent
4e318e6285
commit
0b06dca472
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -741,6 +741,7 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/workflows/i18n-crowdin-upload.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/i18n-crowdin-download.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/pr-go-workspace-check.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/pr-dependabot-update-go-workspace.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/pr-k8s-codegen-check.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/go_lint.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/trivy-scan.yml @grafana/grafana-backend-services-squad
|
||||
|
49
.github/workflows/pr-dependabot-update-go-workspace.yml
vendored
Normal file
49
.github/workflows/pr-dependabot-update-go-workspace.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: "Update Go Workspace for Dependabot PRs"
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- .github/workflows/pr-dependabot-update-go-workspace.yml
|
||||
- go.mod
|
||||
- go.sum
|
||||
- go.work
|
||||
- go.work.sum
|
||||
- '**/go.mod'
|
||||
- '**/go.sum'
|
||||
- '**.go'
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
update:
|
||||
runs-on: "ubuntu-latest"
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Update workspace
|
||||
run: make update-workspace
|
||||
|
||||
- name: Commit and push workspace changes
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
run: |
|
||||
if ! git diff --exit-code --quiet; then
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local --add --bool push.autoSetupRemote true
|
||||
echo "Committing and pushing workspace changes"
|
||||
git remote
|
||||
git branch -l
|
||||
git commit -a -m "update workspace"
|
||||
git push origin $BRANCH_NAME
|
||||
fi
|
9
.github/workflows/pr-go-workspace-check.yml
vendored
9
.github/workflows/pr-go-workspace-check.yml
vendored
@ -4,6 +4,15 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- .github/workflows/pr-go-workspace-check.yml
|
||||
- go.mod
|
||||
- go.sum
|
||||
- go.work
|
||||
- go.work.sum
|
||||
- '**/go.mod'
|
||||
- '**/go.sum'
|
||||
- '**.go'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
|
Loading…
Reference in New Issue
Block a user