Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 50970d8

Browse files
authoredFeb 27, 2024··
Merge branch 'main' into main
Signed-off-by: Derek Ho <derek01778@gmail.com>
2 parents db0e15a + 4b69c09 commit 50970d8

File tree

85 files changed

+1075
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1075
-321
lines changed
 

‎.github/workflows/ci.yml

+15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ jobs:
1818
python3.7 -m pip install nox
1919
- name: Lint the code
2020
run: nox -s lint
21+
22+
generate:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@v3
27+
- name: Set up Python 3.7
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: 3.7
31+
- name: Install dependencies
32+
run: |
33+
python3.7 -m pip install nox
34+
- name: Run the api generator
35+
run: nox -s generate
2136

2237
test-build-distribution:
2338
runs-on: ubuntu-latest

‎.github/workflows/update_api.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update API
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "30 3 * * *"
6+
jobs:
7+
update-api:
8+
if: ${{ github.repository == 'opensearch-project/opensearch-py' }}
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
fetch-depth: 0
18+
- name: Config git to rebase
19+
run: git config --global pull.rebase true
20+
- name: Set up Python 3.7
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: 3.7
24+
- name: Install dependencies
25+
run: |
26+
python3.7 -m pip install nox
27+
- name: Generate API
28+
run: nox -s generate
29+
- name: Get current date
30+
id: date
31+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
32+
- name: GitHub App token
33+
id: github_app_token
34+
uses: tibdex/github-app-token@v1.5.0
35+
with:
36+
app_id: ${{ secrets.APP_ID }}
37+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
38+
installation_id: 22958780
39+
- name: Create pull request
40+
id: cpr
41+
uses: peter-evans/create-pull-request@v5
42+
with:
43+
token: ${{ steps.github_app_token.outputs.token }}
44+
commit-message: Updated opensearch-py to reflect the latest OpenSearch API spec (${{ steps.date.outputs.date }})
45+
title: Updated opensearch-py to reflect the latest OpenSearch API spec
46+
body: |
47+
Updated [opensearch-py](https://github.com/opensearch-project/opensearch-py) to reflect the latest [OpenSearch API spec](https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json)
48+
Date: ${{ steps.date.outputs.date }}
49+
branch: automated-api-update
50+
base: main
51+
signoff: true
52+
labels: |
53+
autocut

0 commit comments

Comments
 (0)
Please sign in to comment.