Skip to content

Third Party Generate #29

Third Party Generate

Third Party Generate #29

# 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 }}