From b2a25690e63f88b11f038e94074dc03991d0ec64 Mon Sep 17 00:00:00 2001 From: Michael Xiao Date: Thu, 5 Dec 2024 12:18:13 -0500 Subject: [PATCH] Local testing --- .changeset/selfish-eagles-destroy.md | 5 ++ .github/workflows/release.yml | 58 +++++++++---------- .../sources/bx-digital/src/transport/price.ts | 11 +++- 3 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 .changeset/selfish-eagles-destroy.md diff --git a/.changeset/selfish-eagles-destroy.md b/.changeset/selfish-eagles-destroy.md new file mode 100644 index 0000000000..2ea5ce8d4a --- /dev/null +++ b/.changeset/selfish-eagles-destroy.md @@ -0,0 +1,5 @@ +--- +'@chainlink/bx-digital-adapter': patch +--- + +Lol diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index faf5855be4..7b8a5d349b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,12 @@ name: Release on: - push: - branches: - - main - # The only commits that will contain changes to the masterlist will be releases + pull_request: paths: - - MASTERLIST.md + - 'packages/sources/**' + - 'packages/composites/**' + - 'packages/targets/**' + - 'packages/core/**' workflow_dispatch: inputs: # For this workflow, build-all will cause all adapters to have their image pulled and republished to the public ECR @@ -86,27 +86,27 @@ jobs: aws-role: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} aws-ecr-private: false - gh-release: - name: GH Release - runs-on: ubuntu-latest - needs: - - publish-adapter-images - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Get release version - id: get-version - run: | - echo "result=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT - - name: Get release body - run: | - # Get the PR body to use in the GH release body - gh pr list --search "$(git rev-parse HEAD)" --state merged --json number,body --jq '"This release was merged in PR #" + (.[0].number | tostring) + "\n" + (.[0].body | split("\n\n\n# Releases") | .[1])' > pr_body.tmp - - name: Create release - uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 - with: - tag_name: v${{ steps.get-version.outputs.result }} - name: Release v${{ steps.get-version.outputs.result }} - body_path: pr_body.tmp + # gh-release: + # name: GH Release + # runs-on: ubuntu-latest + # needs: + # - publish-adapter-images + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + # steps: + # - name: Checkout Repo + # uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + # - name: Get release version + # id: get-version + # run: | + # echo "result=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT + # - name: Get release body + # run: | + # # Get the PR body to use in the GH release body + # gh pr list --search "$(git rev-parse HEAD)" --state merged --json number,body --jq '"This release was merged in PR #" + (.[0].number | tostring) + "\n" + (.[0].body | split("\n\n\n# Releases") | .[1])' > pr_body.tmp + # - name: Create release + # uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 + # with: + # tag_name: v${{ steps.get-version.outputs.result }} + # name: Release v${{ steps.get-version.outputs.result }} + # body_path: pr_body.tmp diff --git a/packages/sources/bx-digital/src/transport/price.ts b/packages/sources/bx-digital/src/transport/price.ts index d8b265bb75..219dfac457 100644 --- a/packages/sources/bx-digital/src/transport/price.ts +++ b/packages/sources/bx-digital/src/transport/price.ts @@ -1,5 +1,8 @@ import { HttpTransport } from '@chainlink/external-adapter-framework/transports' import { BaseEndpointTypes } from '../endpoint/price' +import { makeLogger } from '@chainlink/external-adapter-framework/util' + +const logger = makeLogger('apy-finance-test allocations') export interface ResponseSchema { securityId: string @@ -16,13 +19,19 @@ export type HttpTransportTypes = BaseEndpointTypes & { export const httpTransport = new HttpTransport({ prepareRequests: (params, config) => { return params.map((param) => { + logger.error('Use custome header') return { params: [param], request: { baseURL: config.API_ENDPOINT, headers: { 'API-key': config.API_KEY, - 'User-Agent': config.API_USER_AGENT, + 'User-Agent': + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', + Accept: + 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8', + 'Accept-Language': 'en-US,en;q=0.5', + Referer: 'https://example.com', }, }, }