diff --git a/.github/workflows/master-pipeline.yml b/.github/workflows/master-pipeline.yml index cdd4067e3..4c3a21fec 100644 --- a/.github/workflows/master-pipeline.yml +++ b/.github/workflows/master-pipeline.yml @@ -42,7 +42,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: @@ -122,21 +124,25 @@ jobs: needs: test runs-on: ubuntu-latest if: github.event_name == 'push' + permissions: + contents: read + packages: write steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Login to GitHub Container Registry + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build image and push to GitHub Packages - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v6 with: - username: ${{ github.actor }} - password: ${{ github.token }} - registry: ghcr.io + push: true + no-cache: true repository: giveth/impact-graph - add_git_labels: true - # Add branch name to docker image tag @see{@link https://github.com/docker/build-push-action/tree/releases/v1#tag_with_ref} - tag_with_ref: true - # Add commit hash to docker image tag @see{@link https://github.com/docker/build-push-action/tree/releases/v1#tag_with_sha} - tag_with_sha: true + tags: | + ghcr.io/giveth/impact-graph:master + ghcr.io/giveth/impact-graph:${{ github.sha }} deploy: needs: publish diff --git a/.github/workflows/staging-pipeline.yml b/.github/workflows/staging-pipeline.yml index 6e80e8041..5d574cb87 100644 --- a/.github/workflows/staging-pipeline.yml +++ b/.github/workflows/staging-pipeline.yml @@ -15,7 +15,9 @@ jobs: steps: - name: Check out Git repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Node.js uses: actions/setup-node@v1 @@ -67,7 +69,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: @@ -146,21 +150,25 @@ jobs: needs: test runs-on: ubuntu-latest if: github.event_name == 'push' + permissions: + contents: read + packages: write steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Login to GitHub Container Registry + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build image and push to GitHub Packages - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v6 with: - username: ${{ github.actor }} - password: ${{ github.token }} - registry: ghcr.io + push: true + no-cache: true repository: giveth/impact-graph - add_git_labels: true - # Add branch name to docker image tag @see{@link https://github.com/docker/build-push-action/tree/releases/v1#tag_with_ref} - tag_with_ref: true - # Add commit hash to docker image tag @see{@link https://github.com/docker/build-push-action/tree/releases/v1#tag_with_sha} - tag_with_sha: true + tags: | + ghcr.io/giveth/impact-graph:staging + ghcr.io/giveth/impact-graph:${{ github.sha }} deploy: needs: publish diff --git a/src/services/cronJobs/checkQRTransactionJob.ts b/src/services/cronJobs/checkQRTransactionJob.ts index 8e1005cca..5df8410fb 100644 --- a/src/services/cronJobs/checkQRTransactionJob.ts +++ b/src/services/cronJobs/checkQRTransactionJob.ts @@ -95,15 +95,22 @@ export async function checkTransactions( (isNativePayment || isCreateAccount) && transactionAge < TWO_MINUTES; if (isMatchingTransaction) { - if ( - toWalletMemo && - transaction.type === 'payment' && - transaction.transaction.memo !== toWalletMemo - ) { - logger.debug( - `Transaction memo does not match donation memo for donation ID ${donation.id}`, - ); - return; + const memo = transaction.transaction.memo; + + if (transaction.type === 'payment') { + if (toWalletMemo) { + if (memo !== toWalletMemo) { + logger.debug( + `Transaction memo does not match donation memo for donation ID ${donation.id}`, + ); + return; + } + } else if (memo !== id.toString()) { + logger.debug( + `Transaction memo matches donation memo for donation ID ${donation.id}`, + ); + return; + } } // Check if donation already exists