-
Notifications
You must be signed in to change notification settings - Fork 30
50 lines (45 loc) · 1.54 KB
/
dependencies.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
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 }}