Skip to content

Commit

Permalink
back with files
Browse files Browse the repository at this point in the history
  • Loading branch information
tutkat committed Sep 10, 2024
1 parent 78f95b6 commit 41d92f4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 16 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/auto-commit-client-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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
- 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`
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ public static String serialize(Object obj) {

/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
*
* @param <T> Type
* @param body The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
Expand All @@ -458,7 +458,7 @@ public static <T> T deserialize(String body, Type returnType) {
if (isLenientOnJson) {
JsonReader jsonReader = new JsonReader(new StringReader(body));
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
jsonReader.setLenient(true);
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(body, returnType);
Expand All @@ -468,11 +468,11 @@ public static <T> T deserialize(String body, Type returnType) {
// return the response body string directly for the String return type;
if (returnType.equals(String.class)) {
return (T) body;
} else {
throw (e);
}
} else {
throw (e);
}
}
}
}

/**
* Gson TypeAdapter for Byte Array type
Expand All @@ -484,7 +484,7 @@ public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
out.value(ByteString.of(value).base64());
}
}

Expand All @@ -507,11 +507,11 @@ public byte[] read(JsonReader in) throws IOException {
*/
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {

private DateTimeFormatter formatter;
private DateTimeFormatter formatter;

public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}

public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
Expand Down Expand Up @@ -553,9 +553,9 @@ public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {

private DateTimeFormatter formatter;

public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}

public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
Expand Down

0 comments on commit 41d92f4

Please sign in to comment.