Skip to content

Commit

Permalink
Created a GitHub Action to generate the Third Party report. (#2033)
Browse files Browse the repository at this point in the history
Signed-off-by: David Venable <dlv@amazon.com>
  • Loading branch information
dlvenable authored Dec 22, 2022
1 parent 17829f8 commit 49acfb9
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/third-party-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/github-app-token@v1.5.0
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 }}

0 comments on commit 49acfb9

Please sign in to comment.