-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (51 loc) · 2.08 KB
/
auto-commit-client-updates.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
51
52
53
54
55
56
57
58
59
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Auto commit client updates
on:
workflow_dispatch:
push:
branches: [ "**" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Set git user and generate files
run: |
git config --global user.name 'equinix-labs@auto-commit-workflow'
git config --global user.email '[email protected]'
git config advice.addIgnoredFile false
git fetch
echo -e "\nThis is executing for branch: ${GITHUB_REF##*/}."
git checkout ${GITHUB_REF##*/}
make generate
echo -e "Make execution completed."
- name: Tests
env:
TEST_HOST_URL: https://uatapi.equinix.com
CLIENT_ID: ${{ secrets.TEST_USER_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.TEST_USER_CLIENT_SECRET }}
TEST_USER_NAME: ${{ secrets.TEST_USER_NAME }}
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
shell: bash
working-directory: equinix-openapi-fabric
run: |-
mvn clean package -DenvUrl=${{ env.TEST_HOST_URL }} -DuserName=${{ env.TEST_USER_NAME }} \
-DuserPassword=${{ env.TEST_USER_PASSWORD }} -DclientId=${{ env.CLIENT_ID }} -DclientSecret=${{ env.CLIENT_SECRET }}
- name: Commit to branch.
run: |
git add .
echo -e "\nGit status:"
echo `git status`
cdate=`date`
cmsg="Auto commit generated client changes - $cdate"
echo -e "\nCommit message created : $cmsg"
echo -e "\nCommitting if there are files to update in client dir:"
echo `git commit -m "$cmsg"`
echo `git push`