-
Notifications
You must be signed in to change notification settings - Fork 340
Expand file tree
/
Copy pathcomment-on-submodule-update.yaml
More file actions
39 lines (36 loc) · 1.58 KB
/
Copy pathcomment-on-submodule-update.yaml
File metadata and controls
39 lines (36 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
name: Comment on Submodule Update
on:
pull_request:
branches:
- "master"
- "release/**"
paths:
- "dd-java-agent/agent-jmxfetch/integrations-core"
jobs:
comment_on_submodule_update:
permissions:
id-token: write # Required for OIDC token federation
issues: write # Required to create a comment on the pull request
pull-requests: write # Required to create a comment on the pull request
runs-on: ubuntu-latest
steps:
- name: Get GitHub Token via dd-octo-sts
id: generate-token
uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4
with:
scope: DataDog/dd-trace-java
policy: self.comment-on-submodule-update
- name: Post comment on submodule update
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 9.0.0
with:
github-token: ${{ steps.generate-token.outputs.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' +
'If this was not intentional please make sure to:\n\n' +
'* Update the submodule to the latest commit on the master branch using the `git submodule update` command,\n' +
'* Check you [properly set up your environment for contributing](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#git-submodule-setup).'
})