Update dependencies #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update dependencies | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
workflow_dispatch: | |
# Do not run this if the "deploy" workflow is already running | |
concurrency: | |
group: ${{ github.repository }} | |
cancel-in-progress: false | |
jobs: | |
update-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
cache: 'maven' | |
server-id: openmrs-repo-modules-pih | |
server-username: OPENMRS_MAVEN_USERNAME | |
server-password: OPENMRS_MAVEN_PASSWORD | |
# Set up git config | |
- name: Setup Git Config | |
run: | | |
git config user.name "Github Action" | |
git config user.email "github-action@users.noreply.github.com" | |
- name: Update dependencies | |
run: | | |
mvn clean versions:update-properties -U | |
mvn org.pih.maven.plugin:pih-maven-plugin:1.5.0:dependency-report -Dexcludes=org.openmrs.module:pihcore-api | |
if [ `git status --porcelain=1 | wc -l` -ne 0 ]; then | |
echo "Dependency changes detected" | |
git status | |
mvn scm:add -Dincludes=**/dependencies.txt | |
mvn scm:checkin -Dmessage='automatic update of mvn version dependencies' | |
mvn -B deploy --file pom.xml | |
else | |
echo "No Dependency changes detected" | |
fi | |
env: | |
OPENMRS_MAVEN_USERNAME: ${{ secrets.OPENMRS_MAVEN_USERNAME }} | |
OPENMRS_MAVEN_PASSWORD: ${{ secrets.OPENMRS_MAVEN_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |