Skip to content

Commit

Permalink
feat: Add git submodule change notification bot
Browse files Browse the repository at this point in the history
  • Loading branch information
PerfectSlayer committed Nov 20, 2023
1 parent 4911707 commit 9ab929f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This lists and describes the repository GitHub actions.

### add-assets-to-release [🔗](add-assets-to-release.yaml)

_Trigger:_ When a release is published
_Trigger:_ When a release is published.

_Actions:_
* Ensure the release name is properly formatted (using `x.y.z` format),
Expand All @@ -16,15 +16,15 @@ _Recovery:_ Download artifacts and upload them manually to the release.

### add-milestone-to-pull-requests [🔗](add-milestone-to-pull-requests.yaml)

_Trigger:_ When a PR to `master` is closed
_Trigger:_ When a PR to `master` is closed.

_Action:_ Get the last (by name) opened milestone and affect it to the closed pull request.

_Recovery:_ Attach the milestone by hand to the PR.

### create-next-milestone [🔗](create-next-milestone.yaml)

_Trigger:_ When closing a milestone
_Trigger:_ When closing a milestone.

_Action:_ Create a new milestone by incrementing minor version.

Expand All @@ -44,7 +44,7 @@ _Recovery:_ Manually trigger the action again on the relevant tag.

## increment-milestones-on-tag [🔗](increment-milestones-on-tag.yaml)

_Trigger:_ When creating a tag
_Trigger:_ When creating a tag.

_Actions:_
* Close the milestone related to the tag,
Expand All @@ -57,7 +57,7 @@ As there is no milestone for _patch_ releases, it won't close and create _patch_

## update-download-releases [🔗](update-download-releases.yaml)

_Trigger:_ When a release is published
_Trigger:_ When a release is published.

_Action:_ Update the _download releases_ with the latest release artifact.

Expand All @@ -67,7 +67,7 @@ _Notes:_ _Download releases_ are special GitHub releases with fixed URL and tags

## update-issues-on-release [🔗](update-issues-on-release.yaml)

_Trigger:_ When a release is published
_Trigger:_ When a release is published.

_Action:_
* Find all issues related to the release by checking the related milestone,
Expand All @@ -78,15 +78,21 @@ _Recovery:_ Check at the milestone for the related issues and update them manual

## Code Quality and Security

### comment-on-submodule-update [🔗](comment-on-submodule-update.yaml)

_Trigger:_ When creating a PR commits to `master` or a `release/*` branch with a Git Submodule update.

_Action:_ Notify the PR author through comments that about the Git Submodule update.

### codeql-analysis [🔗](codeql-analysis.yml)

_Trigger:_ When pushing commits to `master` or any pull request to `master`
_Trigger:_ When pushing commits to `master` or any pull request to `master`.

_Action:_ Run GitHub CodeQL action and upload result to GitHub security tab.

### trivy-analysis [🔗](trivy-analysis.yml)

_Trigger:_ When pushing commits to `master` or any pull request to `master`
_Trigger:_ When pushing commits to `master` or any pull request to `master`.

_Action:_ Run Trivy security scanner on built artifacts and upload result to GitHub security tab.

Expand All @@ -100,21 +106,21 @@ _Comment:_ To delete?

### lib-injection [🔗](lib-injection.yaml)

_Trigger:_ When pushing commits to `master`, release branches or any PR targetting `master`, and when creating tags
_Trigger:_ When pushing commits to `master`, release branches or any PR targetting `master`, and when creating tags.

_Actions:_
* Build and publish to GHCR a Docker image with the Java tracer agent,
* Build lib-injection and run its system tests with the build Java agent.

### lib-injection-manual-release [🔗](lib-injection-manual-release.yaml)

_Trigger:_ When manually triggered
_Trigger:_ When manually triggered.

_Action:_ Build and publish to GHCR a Docker image with the given Java tracer version.

### lib-injection-prune-registry [🔗](lib-injection-prune-registry.yaml)

_Trigger:_ Every week or manually
_Trigger:_ Every week or manually.

_Action:_ Clean up old lib-injection Docker images from GHCR.

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/comment-on-submodule-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Comment on Submodule Update

on:
pull_request:
branches:
- 'master'
- 'release/**'
paths:
- 'dd-java-agent/agent-jmxfetch/integrations-core'

jobs:
comment_on_submodule_update:
runs-on: ubuntu-latest

steps:
- name: Post comment on submodule update
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # 6.3.3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hi! 👋 Looks like you updated a Git Submodule.\n' +
'It is okay to do it on purpose, but if it is not, please make sure:\n\n' +
'* to update the submodule to the latest commit on the master branch using the `git submodule update` command,\n' +
'* to [check your setup for contributing](CONTRIBUTING.md#git-submodule-setup).'
})
2 changes: 1 addition & 1 deletion dd-java-agent/agent-jmxfetch/integrations-core

0 comments on commit 9ab929f

Please sign in to comment.