Skip to content

Workflow file for this run

name: Update license file
on:
push:
branches:
- 'dependabot/**'
# Workflows triggered by Dependabot have a read-only token by default.
# Need to grant write permissions so this workflow can commit changes to the license file.
permissions:
contents: write
jobs:
update_license_file:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21.0.2+13.0.LTS'
distribution: 'adopt'
- name: install git secrets
run: |
wget --no-verbose -O git-secrets-1.3.0.tar.gz https://github.com/awslabs/git-secrets/archive/1.3.0.tar.gz
tar -zxf git-secrets-1.3.0.tar.gz
cd git-secrets-1.3.0
sudo make install
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with mvnw
run: ./mvnw clean install
- name: Push changes if license file changed
run: |
if [ -n "$(git status --porcelain | grep "THIRD-PARTY-LICENSES")" ]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dockstore-webservice/src/main/resources/openapi3/openapi.yaml dockstore-webservice/src/main/resources/swagger.yaml **/generated/**/pom.xml
git add THIRD-PARTY-LICENSES.txt
git add THIRD-PARTY-LICENSES.dev.txt
git commit -m "Update license file"
git push
else
echo "There were no changes to THIRD-PARTY-LICENSES.txt or THIRD-PARTY-LICENSES.dev.txt"
fi