From 8546d72adc1b79c23213b8d77e0d201902da48a6 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:57:21 +0100 Subject: [PATCH 01/16] feat: added automated /cartridges folder commit --- .github/workflows/cartridges-commit.yml | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/cartridges-commit.yml diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml new file mode 100644 index 0000000000..5a42b10f99 --- /dev/null +++ b/.github/workflows/cartridges-commit.yml @@ -0,0 +1,52 @@ +name: Release Workflow + +on: + pull_request: + branches: + - 'feature/*' + +jobs: + setup-the-cartridge: + if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - sfra-version: 'v6.1.0' + sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA6' + code-version-secret: 'SFCC_CODE_VERSION_SFRA6' + steps: + - name: Checkout SFRA code + uses: actions/checkout@v3 + with: + repository: SalesforceCommerceCloud/storefront-reference-architecture + ref: ${{ matrix.sfra-version }} + ssh-key: ${{ secrets.SERVICE_ACCOUNT_SSH_KEY }} + path: storefront-reference-architecture + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '14' + - name: Checkout + uses: actions/checkout@v3 + with: + path: adyen-salesforce-commerce-cloud + - name: Install SFRA dependencies + working-directory: storefront-reference-architecture + run: npm install + - name: Install Adyen SFCC dependencies + working-directory: adyen-salesforce-commerce-cloud + run: npm install + - name: Build the code + working-directory: adyen-salesforce-commerce-cloud + run: | + npm run transpile && npm run compile:js | tee build_output.txt + shell: bash + - name: Commit changes + if: success() + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + git add build_output.txt + git commit -m "chore: Commiting the built /cartridge folder" From 77c3c3737be7b0816f56343d769fd679d66a0dad Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:07:33 +0100 Subject: [PATCH 02/16] chore: changing condition to simulate the run --- .github/workflows/cartridges-commit.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 5a42b10f99..16d321ef59 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -1,9 +1,6 @@ name: Release Workflow -on: - pull_request: - branches: - - 'feature/*' +on: [push, pull_request] jobs: setup-the-cartridge: From 1476e56e9376e74cc935da4b1fe2850c664d44fa Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:23:37 +0100 Subject: [PATCH 03/16] chore: testing the condition --- .github/workflows/cartridges-commit.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 16d321ef59..2f441259ae 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -1,6 +1,10 @@ name: Release Workflow -on: [push, pull_request] +on: + pull_request: + paths-ignore: + - 'int_adyen_controllers/**' + - 'adyen_controllers_changes/**' jobs: setup-the-cartridge: From dab67dda0d71de49e6727774d71f21d31fe413e1 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:21:39 +0100 Subject: [PATCH 04/16] feat: updated the logic of the workflow --- .github/workflows/cartridges-commit.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 2f441259ae..3b931e3e67 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -7,7 +7,7 @@ on: - 'adyen_controllers_changes/**' jobs: - setup-the-cartridge: + commit-the-cartridge: if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }} runs-on: ubuntu-latest strategy: @@ -47,7 +47,9 @@ jobs: - name: Commit changes if: success() run: | + cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" git add build_output.txt - git commit -m "chore: Commiting the built /cartridge folder" + git commit -m "chore: Committing the built /cartridge folder" + git push origin HEAD:${{ github.head_ref }} From c2bab08fce021b103275f0ae1e434f7164ed96b1 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:25:07 +0100 Subject: [PATCH 05/16] chore: fixed commit message to comply eslint --- .github/workflows/cartridges-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 3b931e3e67..299f29c545 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -51,5 +51,5 @@ jobs: git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" git add build_output.txt - git commit -m "chore: Committing the built /cartridge folder" + git commit -m "chore: committing the built /cartridge folder" git push origin HEAD:${{ github.head_ref }} From 02373f3592065f41e15841adf29a5bab8b149443 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:31:21 +0100 Subject: [PATCH 06/16] chore: added fetch step to fetch inside github actions --- .github/workflows/cartridges-commit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 299f29c545..c12e8a9493 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -52,4 +52,6 @@ jobs: git config --local user.name "GitHub Actions" git add build_output.txt git commit -m "chore: committing the built /cartridge folder" + git fetch origin + git merge origin/${{ github.head_ref }} git push origin HEAD:${{ github.head_ref }} From a73095bb4d40dad12ee49de277a125900b4be2d9 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:38:28 +0100 Subject: [PATCH 07/16] chore: removed merge step --- .github/workflows/cartridges-commit.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index c12e8a9493..b6aacbd18b 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -53,5 +53,4 @@ jobs: git add build_output.txt git commit -m "chore: committing the built /cartridge folder" git fetch origin - git merge origin/${{ github.head_ref }} git push origin HEAD:${{ github.head_ref }} From 383254f4c4a3ee16fddb092f184973e85e42b89d Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:46:11 +0100 Subject: [PATCH 08/16] chore: trying force push into the branch to resolve the issue --- .github/workflows/cartridges-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index b6aacbd18b..8e17214f95 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -53,4 +53,4 @@ jobs: git add build_output.txt git commit -m "chore: committing the built /cartridge folder" git fetch origin - git push origin HEAD:${{ github.head_ref }} + git push origin HEAD:${{ github.head_ref }} --force-with-lease From d8fdac1e972ab3d90ef2ac07acd060a5a1e4d0e5 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:52:15 +0100 Subject: [PATCH 09/16] chore: changed the files to be added --- .github/workflows/cartridges-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 8e17214f95..45dbad0252 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -50,7 +50,7 @@ jobs: cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add build_output.txt + git add cartridge/**/* git commit -m "chore: committing the built /cartridge folder" git fetch origin git push origin HEAD:${{ github.head_ref }} --force-with-lease From 62b99c8488bb877fe21eeb3776ec07dad1271661 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:01:04 +0100 Subject: [PATCH 10/16] chore: saving the cartridge folder in order to be available during commit --- .github/workflows/cartridges-commit.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 45dbad0252..9f4ad7d6ce 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -43,6 +43,8 @@ jobs: working-directory: adyen-salesforce-commerce-cloud run: | npm run transpile && npm run compile:js | tee build_output.txt + mkdir -p $GITHUB_WORKSPACE/cartridge + cp -R cartridge/* $GITHUB_WORKSPACE/cartridge shell: bash - name: Commit changes if: success() @@ -50,7 +52,7 @@ jobs: cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add cartridge/**/* + git add $GITHUB_WORKSPACE/cartridge/* git commit -m "chore: committing the built /cartridge folder" git fetch origin git push origin HEAD:${{ github.head_ref }} --force-with-lease From ed54201244e5e6ead10b611a6fd9d8c7ac756719 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:04:31 +0100 Subject: [PATCH 11/16] chore: updated the dir name --- .github/workflows/cartridges-commit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 9f4ad7d6ce..08dc1577cd 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -43,8 +43,8 @@ jobs: working-directory: adyen-salesforce-commerce-cloud run: | npm run transpile && npm run compile:js | tee build_output.txt - mkdir -p $GITHUB_WORKSPACE/cartridge - cp -R cartridge/* $GITHUB_WORKSPACE/cartridge + mkdir -p $GITHUB_WORKSPACE/cartridges + cp -R cartridge/* $GITHUB_WORKSPACE/cartridges shell: bash - name: Commit changes if: success() @@ -52,7 +52,7 @@ jobs: cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add $GITHUB_WORKSPACE/cartridge/* + git add $GITHUB_WORKSPACE/cartridges/* git commit -m "chore: committing the built /cartridge folder" git fetch origin git push origin HEAD:${{ github.head_ref }} --force-with-lease From 10746ac1856bf79898f98604c29ca0c43398e22b Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:07:31 +0100 Subject: [PATCH 12/16] chore: rename v2 --- .github/workflows/cartridges-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 08dc1577cd..0fc65d7b92 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -44,7 +44,7 @@ jobs: run: | npm run transpile && npm run compile:js | tee build_output.txt mkdir -p $GITHUB_WORKSPACE/cartridges - cp -R cartridge/* $GITHUB_WORKSPACE/cartridges + cp -R cartridges/* $GITHUB_WORKSPACE/cartridges shell: bash - name: Commit changes if: success() From bbec1a702c099e5e667f234f7354adb6ed24ca3a Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:14:04 +0100 Subject: [PATCH 13/16] fix: removed paths ignore as its part of the built --- .github/workflows/cartridges-commit.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 0fc65d7b92..9c554612d8 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -2,9 +2,6 @@ name: Release Workflow on: pull_request: - paths-ignore: - - 'int_adyen_controllers/**' - - 'adyen_controllers_changes/**' jobs: commit-the-cartridge: From 0c393d793d67a29788f4504632f6759ddc65692c Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:20:11 +0100 Subject: [PATCH 14/16] fix: added fetch depth to address the missing commits --- .github/workflows/cartridges-commit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 9c554612d8..e298595785 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -30,6 +30,7 @@ jobs: uses: actions/checkout@v3 with: path: adyen-salesforce-commerce-cloud + fetch-depth: 0 - name: Install SFRA dependencies working-directory: storefront-reference-architecture run: npm install @@ -49,7 +50,7 @@ jobs: cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add $GITHUB_WORKSPACE/cartridges/* + git add . git commit -m "chore: committing the built /cartridge folder" git fetch origin git push origin HEAD:${{ github.head_ref }} --force-with-lease From 113fc5ee38a17e76f99758dab3abc96bd7bef480 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:28:20 +0100 Subject: [PATCH 15/16] chore: removed txt file from pipeline and added only cartridges folder to commit --- .github/workflows/cartridges-commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index e298595785..6eae21db4f 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -40,7 +40,7 @@ jobs: - name: Build the code working-directory: adyen-salesforce-commerce-cloud run: | - npm run transpile && npm run compile:js | tee build_output.txt + npm run transpile && npm run compile:js mkdir -p $GITHUB_WORKSPACE/cartridges cp -R cartridges/* $GITHUB_WORKSPACE/cartridges shell: bash @@ -50,7 +50,7 @@ jobs: cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add . + git add cartridge/**/* git commit -m "chore: committing the built /cartridge folder" git fetch origin git push origin HEAD:${{ github.head_ref }} --force-with-lease From c18f8c431e6967fd74f88d5129c0b7ea83e5e98d Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:33:31 +0100 Subject: [PATCH 16/16] chore: renamed the path --- .github/workflows/cartridges-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cartridges-commit.yml b/.github/workflows/cartridges-commit.yml index 6eae21db4f..6c9c75ade4 100644 --- a/.github/workflows/cartridges-commit.yml +++ b/.github/workflows/cartridges-commit.yml @@ -50,7 +50,7 @@ jobs: cd adyen-salesforce-commerce-cloud git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add cartridge/**/* + git add cartridges/**/* git commit -m "chore: committing the built /cartridge folder" git fetch origin git push origin HEAD:${{ github.head_ref }} --force-with-lease