-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding github action to update client
- Loading branch information
1 parent
f405fd1
commit f77a541
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Update Client | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Docker | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Step 3: Run Docker command | ||
- name: Run Docker command to generate files | ||
run: | | ||
docker run --rm -v ${{ github.workspace }}:/onelens-backend-python-client" openapitools/openapi-generator-cli generate -i https://dev-api.onelens.cloud/openapi.json -g python -o /onelens-backend-python-client/ -t /onelens-backend-python-client/templates/ -c /onelens-backend-python-client/config.yaml -p packageName=onelens_backend_client -p projectName=onelens-backend-python-client --skip-validate-spec | ||
# Step 4: Configure Git | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
# Step 5: Add and commit changes | ||
- name: Add and commit changes | ||
run: | | ||
cd ${{ github.workspace }} | ||
git add . | ||
git commit -m "Generated files by GitHub Action" | ||
# Step 6: Push changes | ||
- name: Push changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git push origin HEAD:${{ github.ref }} |