Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post dependabot action to update notice file #3351

Merged
merged 4 commits into from
Mar 13, 2024

Conversation

michel-laterman
Copy link
Contributor

@michel-laterman michel-laterman commented Mar 13, 2024

Add post-dependabot action to update NOTICE.txt file.
Also include steps to update testing/go.mod and testing/go.sum files if dependabot update would break e2e testing.
Copied from elastic/elastic-agent#4012

@michel-laterman michel-laterman requested a review from cmacknz March 13, 2024 09:19
@michel-laterman michel-laterman requested a review from a team as a code owner March 13, 2024 09:19
git config --global user.name 'dependabot[bot]'
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
git add NOTICE.txt
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do anything to setup secrets.GITHUB_TOKEN?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Agent repo has the same setup as the fleet-server one.

Comment on lines +25 to +40
- name: run go mod tidy in testing/
run: cd testing; go mod tidy

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

- name: commit testing/go.mod and testing/go.sum files
if: steps.testing-mod-check.outputs.modified == 'true'
run: |
git config --global user.name 'dependabot[bot]'
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
git add 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 "Update testing/go.mod and testing/go.sum files"
git push
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlind23, I've added some additional steps to the action to update the testing/go.mod and testing/go.sum files if needed; it should fix failures where the updated dependencies are used by the testing libs such as #3347

@michel-laterman michel-laterman enabled auto-merge (squash) March 13, 2024 10:56
Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
No Duplication information No data about Duplication

See analysis details on SonarQube

@michel-laterman michel-laterman merged commit 790201e into elastic:main Mar 13, 2024
8 checks passed
@michel-laterman michel-laterman deleted the post-dependabot-action branch March 13, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants