From dad3a00852f775d675898cf72c1700911e624a45 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 25 Oct 2024 18:18:25 -0400 Subject: [PATCH 1/3] Update checkout sha of the code Signed-off-by: Peter Zhu --- .github/workflows/build-test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 40f9901..e5fb183 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -16,8 +16,14 @@ jobs: - 18 - 20 runs-on: ubuntu-latest + if: github.repository == 'opensearch-project/automation-app' steps: - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request_target' + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Set up node-${{ matrix.node-version }} uses: actions/setup-node@v4 with: @@ -35,6 +41,7 @@ jobs: - name: Run junit run: npm run junit - name: Upload results to Codecov + if: ${{ !cancelled() }} uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} From fc544c1d5c32a6506b3d2bd8e8d414e918c3cb9b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 25 Oct 2024 18:21:08 -0400 Subject: [PATCH 2/3] More tweaks Signed-off-by: Peter Zhu --- package-lock.json | 4 ++-- package.json | 4 ++-- src/utility/opensearch/opensearch-client.ts | 11 +++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7fbb43d..ac6eab1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opensearch-automation-app", - "version": "0.1.14", + "version": "0.1.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opensearch-automation-app", - "version": "0.1.14", + "version": "0.1.15", "dependencies": { "@aws-sdk/client-cloudwatch": "^3.664.0", "@aws-sdk/client-opensearch": "^3.658.1", diff --git a/package.json b/package.json index 7d4060f..d822f68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-automation-app", - "version": "0.1.14", + "version": "0.1.15", "description": "An Automation App that handles all your GitHub Repository Activities", "author": "Peter Zhu", "homepage": "https://github.com/opensearch-project/automation-app", @@ -68,4 +68,4 @@ "engines": { "node": ">= 18" } -} \ No newline at end of file +} diff --git a/src/utility/opensearch/opensearch-client.ts b/src/utility/opensearch/opensearch-client.ts index d7a1fd6..d2c2dfe 100644 --- a/src/utility/opensearch/opensearch-client.ts +++ b/src/utility/opensearch/opensearch-client.ts @@ -40,12 +40,11 @@ export class OpensearchClient { const client = new OpenSearchClient({ ...AwsSigv4Signer({ region: this._region, - getCredentials: () => - Promise.resolve({ - accessKeyId: credentials.AccessKeyId!, - secretAccessKey: credentials.SecretAccessKey!, - sessionToken: credentials.SessionToken!, - }), + getCredentials: () => Promise.resolve({ + accessKeyId: credentials.AccessKeyId!, + secretAccessKey: credentials.SecretAccessKey!, + sessionToken: credentials.SessionToken!, + }), }), node: this._openSearchUrl, }); From 41e0c6b85ea818aba9bbe4368638c8bd8009ed01 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 25 Oct 2024 18:24:07 -0400 Subject: [PATCH 3/3] more tweaks Signed-off-by: Peter Zhu --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e5fb183..1767b09 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 if: github.event_name == 'push' - uses: actions/checkout@v4 - if: github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' with: ref: ${{ github.event.pull_request.head.sha }} - name: Set up node-${{ matrix.node-version }}