Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/elastic/ela…
Browse files Browse the repository at this point in the history
…stic-agent-libs-0.7.5
  • Loading branch information
michel-laterman authored Mar 13, 2024
2 parents 4b4c0fa + 15ffc2d commit 969ccc8
Show file tree
Hide file tree
Showing 4 changed files with 1,564 additions and 237 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Follow-on actions relating to dependabot PRs. In elastic/fleet-server, any changes to
# dependencies contained in go.mod requires the change to be reflected in the
# NOTICE.txt file. When dependabot creates a branch for a go_modules change this
# will update the NOTICE.txt file for that change.
name: post-dependabot

on:
push:
branches:
- 'dependabot/go_modules/**'

jobs:
update-notice:
permissions:
# Allow job to write to the branch.
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version-file: .go-version

- name: update NOTICE.txt
run: make notice

- name: run go mod tidy in testing/
run: cd testing; go mod tidy

- name: check for modified files
id: check-files
run: echo "modified=$(if git diff-index --quiet HEAD -- NOTICE.txt testing/go.mod testing/go.sum; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT

- name: commit modified files
if: steps.check-files.outputs.modified == 'true'
run: |
git config --global user.name 'dependabot[bot]'
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
git add NOTICE.txt testing/go.mod testing/go.sum
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -m "Post dependabot file modifications"
git push
Loading

0 comments on commit 969ccc8

Please sign in to comment.