Repository navigation
52 lines (48 loc) · 1.58 KB
/
Copy pathsync-deps.yaml
File metadata and controls
52 lines (48 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Sync Dependencies
on:
push:
branches:
- "dependabot/**"
paths:
- go.mod
permissions:
contents: read
jobs:
sync-deps:
name: Sync Dependencies
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref }}
ssh-key: ${{ secrets.DEPENDABOT_DEPLOY_KEY }}
- name: Set up Go
uses: ./.github/actions/set-up-go
- name: Run sync-deps
run: make sync-deps
- name: Sync golangci-lint version to code-checker workflow
run: |
version=$(go list -modfile=tools/go.mod -m -f '{{ .Version }}' github.com/golangci/golangci-lint/v2)
sed -i "s/GOLANGCI_LINT_VERSION: v.*/GOLANGCI_LINT_VERSION: ${version}/" .github/workflows/code-checker.yml
- name: Check for changes
id: changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changes=true" >> "$GITHUB_OUTPUT"
echo "Found dependency changes:"
git status --short
else
echo "changes=false" >> "$GITHUB_OUTPUT"
echo "No dependency changes found"
fi
- name: Commit changes
if: steps.changes.outputs.changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "make sync-deps" --signoff
git push