Skip to content

Commit ff89002

Browse files
authoredMay 30, 2023
Enable auto-updates of github.com/elastic/* dependencies. (#2744)
* Enable auto-updates of github.com/elastic/* deps. Enable dependabot to automatically keep internal dependencies up to date. Can be expanded to external dependencies eventually. * Add the skip-changelog label initially. * Use Elastic-Agent label instead of Control-Plane.
1 parent cda5b7e commit ff89002

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
 

‎.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
labels:
9+
- automation
10+
- skip-changelog
11+
- Team:Elastic-Agent
12+
allow:
13+
- dependency-name: "github.com/elastic/*"
14+
reviewers:
15+
- "elastic/elastic-agent-control-plane"
16+
open-pull-requests-limit: 10

‎.github/workflows/post-dependabot.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Follow-on actions relating to dependabot PRs. In elastic/elastic-agent, any changes to
2+
# dependencies contained in go.mod requires the change to be reflected in the
3+
# NOTICE.txt file. When dependabot creates a branch for a go_modules change this
4+
# will update the NOTICE.txt file for that change.
5+
name: post-dependabot
6+
7+
on:
8+
push:
9+
branches:
10+
- 'dependabot/go_modules/**'
11+
12+
jobs:
13+
update-notice:
14+
permissions:
15+
# Allow job to write to the branch.
16+
contents: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: actions/setup-go@v4
22+
with:
23+
go-version-file: .go-version
24+
25+
- name: update NOTICE.txt
26+
run: make notice
27+
28+
- name: check for modified NOTICE.txt
29+
id: notice-check
30+
run: echo "modified=$(if git diff-index --quiet HEAD -- NOTICE.txt; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
31+
32+
- name: commit NOTICE.txt
33+
if: steps.notice-check.outputs.modified == 'true'
34+
run: |
35+
git config --global user.name 'dependabot[bot]'
36+
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
37+
git add NOTICE.txt
38+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
39+
git commit -m "Update NOTICE.txt"
40+
git push

0 commit comments

Comments
 (0)