-
Notifications
You must be signed in to change notification settings - Fork 217
54 lines (44 loc) · 1.62 KB
/
third-party-generate.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This workflow generates the THIRD-PARTY file and creates a PR from the changes.
# For more information see: https://github.com/marketplace/actions/create-pull-request
name: Third Party Generate
on:
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Data Prepper
uses: actions/checkout@v2
- name: Generate Third Party Report
run: ./gradlew --no-daemon generateThirdPartyReport
- name: Get Git metadata
run: |
echo GIT_SHORT_HASH=`git rev-parse --short "$GITHUB_SHA"` >> $GITHUB_ENV
echo GITHUB_REF_NAME=${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ steps.github_app_token.outputs.token }}
add-paths: THIRD-PARTY
commit-message: 'Generated THIRD-PARTY file for ${{ env.GIT_SHORT_HASH }}'
signoff: true
branch: third-party/third-party-${{ env.GIT_SHORT_HASH }}-to-${{ env.GITHUB_REF_NAME }}
delete-branch: true
title: 'Generated THIRD-PARTY file for ${{ env.GIT_SHORT_HASH }}'
body: |
Generated `THIRD-PARTY` file with:
```
./gradlew --no-daemon generateThirdPartyReport
```
Branch: ${{ env.GITHUB_REF_NAME }}
Commit: ${{ env.GIT_SHORT_HASH }}