corrected #94
Workflow file for this run
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
# 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: | |
inputs: | |
new_api_spec_version_number: | |
required: true | |
test_host_url: | |
default: https://uatapi.equinix.com | |
push: | |
branches: [ "**" ] | |
jobs: | |
build: | |
runs-on: [ self-hosted , kubernetes , nonprod , onprem , ecx ] | |
steps: | |
- name: Get vault token | |
uses: equinix-product/vault-action@v1 | |
with: | |
vault: secretsnonprod | |
namespace: ecx | |
secrets: | | |
nonprod/data/panthers/terratests-uat-sanity/PFCR equinix_client_id | CLIENT_ID; | |
nonprod/data/panthers/terratests-uat-sanity/PFCR equinix_client_secret | CLIENT_SECRET; | |
nonprod/data/panthers/terratests-uat-sanity/PFCR user_name | TEST_USER_NAME; | |
nonprod/data/panthers/terratests-uat-sanity/PFCR user_password | TEST_USER_PASSWORD; | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
- name: Commit to branch if client is updated after executing make. | |
env: | |
CLIENT_ID: ${{ env.CLIENT_ID }} | |
CLIENT_SECRET: ${{ env.CLIENT_SECRET }} | |
TEST_USER_NAME: ${{ env.TEST_USER_NAME }} | |
TEST_USER_PASSWORD: ${{ env.TEST_USER_PASSWORD }} | |
shell: bash | |
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 | |
build_client: | |
echo -e "Make execution completed." | |
git add equinix-openapi-fabric/. | |
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` |