Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
1750ef3
Add S3 client with role based access
shethj Aug 1, 2025
25e39f5
Get and put S3 objects with ETag
shethj Aug 1, 2025
b170e2c
Create MRTTargetManager script
shethj Aug 2, 2025
7e88644
Update mrt-target-manager with status command
shethj Aug 2, 2025
76b625d
Organize coded
shethj Aug 2, 2025
2f71fe2
Update release command
shethj Aug 2, 2025
e76e32b
Implement composite action for e2e_acquire_mrt_target
shethj Aug 2, 2025
e369995
Restore credentials
shethj Aug 2, 2025
343bd5e
Restrict write actions in local dev
shethj Aug 2, 2025
2f4cfe5
Clean up env vars
shethj Aug 2, 2025
dd3a609
Added Install monorepo dependencies step
shethj Aug 2, 2025
8808b7d
Update S3 client options
shethj Aug 2, 2025
1e98302
Add Configure AWS credentials step for github actions
shethj Aug 2, 2025
44e00b3
Update OIDC Permissions for Github AWS Auth
shethj Aug 2, 2025
45ffa66
Fix roleSessionName
shethj Aug 2, 2025
543da2f
Check read only
shethj Aug 2, 2025
af98be2
Check process.env.ci
shethj Aug 2, 2025
186672d
Fix readonly logic
shethj Aug 2, 2025
c2f9cd1
Return output from script to Github
shethj Aug 2, 2025
8969f0e
Update output format
shethj Aug 2, 2025
6c0c9e4
Echo outputs in github actions
shethj Aug 2, 2025
c022e79
Echo output
shethj Aug 2, 2025
b526290
Print github output
shethj Aug 2, 2025
5a33cd4
print github output
shethj Aug 2, 2025
6ecf352
Set output using @actions/core
shethj Aug 2, 2025
3970951
Test outputs
shethj Aug 2, 2025
c904d2c
Add shell
shethj Aug 2, 2025
e150bbb
Update sessionName
shethj Aug 2, 2025
dc00c9e
Return outputs to workflows
shethj Aug 2, 2025
675b22b
Return outputs
shethj Aug 2, 2025
180d0a6
output
shethj Aug 2, 2025
7f5cfe0
Print MRT target details to a json file
shethj Aug 4, 2025
58087c9
Fix imports
shethj Aug 4, 2025
0bbedb7
Fix imports
shethj Aug 4, 2025
59d9188
Use slug to match MRT key instead of mrtEnvId
shethj Aug 5, 2025
4fcb235
Update pool json properties
shethj Aug 5, 2025
228361d
Remove MRT target scaling for now
shethj Aug 5, 2025
a523abd
Remove sample json
shethj Aug 5, 2025
12b220d
Remove code for release env
shethj Aug 5, 2025
55a6d22
Refactor commander options
shethj Aug 5, 2025
277d796
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 5, 2025
ff2187f
Update role session name
shethj Aug 5, 2025
9afec69
Extract string literals to constants
shethj Aug 5, 2025
9c4bd2d
Extract externalId to env var and remove for CI runs
shethj Aug 6, 2025
3bf5c02
Added todo to remove roleARN
shethj Aug 6, 2025
95d7144
Remove roleArn for CI
shethj Aug 6, 2025
6227e84
Combine ciRunInfo into own object
shethj Aug 6, 2025
3783716
Added jsdoc and removed unused functions
shethj Aug 6, 2025
9015ff2
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 6, 2025
d8ae4cc
Remove unused imports
shethj Aug 6, 2025
a2749df
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 7, 2025
30ab984
Add docs explaining the output file is automatically deleted
shethj Aug 7, 2025
62fa091
Add unit tests
shethj Aug 7, 2025
a9bc6dc
Add unit tests for e2e/scripts
shethj Aug 7, 2025
7a814b1
Remove gtime check when running npm ci
shethj Aug 7, 2025
cdc8c07
Added tests
shethj Aug 7, 2025
4629fd6
Fix dependency cycles
shethj Aug 7, 2025
f834db1
Fix test issues
shethj Aug 7, 2025
e691681
Fix linting
shethj Aug 7, 2025
50ef1f7
Restore gtime check
shethj Aug 7, 2025
6fcf690
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 7, 2025
a19615f
Move e2e/scripts/package.json up a level
shethj Aug 7, 2025
86ae5d1
Fix linting in other e2e test files
shethj Aug 7, 2025
3eb1669
Remove redundant package defs
shethj Aug 7, 2025
1e5d83d
Exclude playwright tests from jest runs
shethj Aug 7, 2025
8e1a71b
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 7, 2025
f6622d5
Use test instead of it for tests
shethj Aug 7, 2025
f99e2cc
Use more robust JS Object method to check if a property exists in an …
shethj Aug 7, 2025
079472b
Update e2e/scripts/pageHelpers.js
shethj Aug 7, 2025
f5464bc
Added release env command to mrt-target-manager
shethj Aug 8, 2025
4c6cc61
Setup post hook to release MRT target back to pool
shethj Aug 8, 2025
99149e3
FIx release action file name
shethj Aug 8, 2025
bf95e57
Fix node version on release mrt action
shethj Aug 8, 2025
b9baf5f
Exclude github dist from gitignore
shethj Aug 8, 2025
1efc830
Remove external dependency when running cleanup
shethj Aug 8, 2025
2c666f1
Added unit tests for release target
shethj Aug 8, 2025
d9010e7
Move trusted agent exception above the generic case
vcua-mobify Aug 11, 2025
1d75047
Merge pull request #3031 from SalesforceCommerceCloud/feature/ci-tear…
shethj Aug 12, 2025
4029a78
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 13, 2025
d02037a
Sleep workflow for 30s
shethj Aug 13, 2025
734d5a8
Optionally send ci args to acquire
shethj Aug 13, 2025
755f2e6
Remove specific user not found message
vcua-mobify Aug 11, 2025
45f9680
Added action and helpers to update MRT Target
shethj Aug 13, 2025
1cd96c7
CI trigger
shethj Aug 13, 2025
5c4e1e2
Ci trigger
shethj Aug 13, 2025
5c4e3cb
Handle JSON input in bash
shethj Aug 13, 2025
136b3fd
Fix proxy json input
shethj Aug 13, 2025
961dde5
Remove double string quotes
shethj Aug 14, 2025
74bffe8
Remove double string quotes
shethj Aug 14, 2025
0148c37
Handle JSON string as inputs
shethj Aug 14, 2025
007b96f
Fix mrt hostname
shethj Aug 14, 2025
495aed5
Modify user not found responses from SLAS
vcua-mobify Aug 14, 2025
0cc88ad
Update MRT API secret
shethj Aug 14, 2025
fae3ee2
Remove stringify from fetch body
shethj Aug 14, 2025
ee18091
Fix json formatting for payload
shethj Aug 14, 2025
5fffa3c
Handle bash escaping
shethj Aug 14, 2025
c2a0114
Fix command
shethj Aug 14, 2025
23a4b1c
FIx args
shethj Aug 14, 2025
cb955dc
User not found returns 200
vcua-mobify Aug 14, 2025
011c199
Handling for responses with no body
vcua-mobify Aug 14, 2025
a556352
Merge branch 'develop' into slas-proxy-improvements
vcua-mobify Aug 14, 2025
b436f20
Set env vars to dynamic MRT target
shethj Aug 15, 2025
00c8482
Debug invalid key
shethj Aug 15, 2025
38881a6
Pass in cloud origin to env-var API
shethj Aug 15, 2025
9942a2e
Pass in cloud origin to e2e-pr workflow
shethj Aug 15, 2025
0aa9032
Added tests for update-mrt-target
shethj Aug 15, 2025
0bb0e69
Remove redundant tests
shethj Aug 15, 2025
d7acee2
Update agent_checkout_rebase_action.yml
nsethun123 Aug 15, 2025
8f1e198
Update agent_checkout_rebase_action.yml
nsethun123 Aug 15, 2025
3fb7c5c
Fix how 403s are sent now that selfHandleResponse is true
vcua-mobify Aug 15, 2025
9abf5c6
Add test
vcua-mobify Aug 15, 2025
9aa0de0
Merge branch 'develop' into slas-proxy-improvements
vcua-mobify Aug 15, 2025
d68e4ee
Remove unused message
vcua-mobify Aug 15, 2025
af2656e
Changelog updates
vcua-mobify Aug 15, 2025
283ed3f
Update translations
vcua-mobify Aug 15, 2025
c73b214
Remove test case that is no longer needed
vcua-mobify Aug 15, 2025
4dd4814
Update agent_checkout_rebase_action.yml
nsethun123 Aug 18, 2025
37996b9
Minor Cleanup
snilakandan13 Aug 18, 2025
4609936
CI perf workflow: fix the deploy step.. take two (@W-19345469@) (#3115)
vmarta Aug 18, 2025
b036ab5
make actions description clearer
shethj Aug 18, 2025
a8180f9
Merge branch 'develop' into t/commerce/W-19159067/cleanupForMCPTools
snilakandan13 Aug 18, 2025
0b6008c
Use overwrite for env vars
shethj Aug 18, 2025
313ee7e
Apply feedback
vcua-mobify Aug 18, 2025
a3ec583
lint
vcua-mobify Aug 18, 2025
817b19a
Merge pull request #3118 from SalesforceCommerceCloud/t/commerce/W-19…
snilakandan13 Aug 18, 2025
e5e56ac
Merge branch 'develop' into update-agent-checkout-rebase-action
nsethun123 Aug 18, 2025
83c4a91
Merge pull request #3106 from SalesforceCommerceCloud/update-agent-ch…
nsethun123 Aug 18, 2025
7dfd242
Lockdown chakra-ui version to 2.6.0
shethj Aug 19, 2025
f03d74c
Update changelog
shethj Aug 19, 2025
b3ec2ee
Merge branch 'develop' into bugfix/lockdown-chakra-ui-react-version
shethj Aug 19, 2025
eee23cf
Pin v2.7.0
shethj Aug 19, 2025
630e52d
Bump vendor bundle size
shethj Aug 19, 2025
8604f1d
Merge pull request #3132 from SalesforceCommerceCloud/bugfix/lockdown…
shethj Aug 19, 2025
84689d0
Merge branch 'develop' into slas-proxy-improvements
vcua-mobify Aug 19, 2025
6512d91
Merge pull request #3113 from SalesforceCommerceCloud/slas-proxy-impr…
vcua-mobify Aug 19, 2025
baabc53
Skip deleting dwsid on login for if hybrid auth is enabled
shethj Aug 21, 2025
0568a4e
Update changelog
shethj Aug 21, 2025
a6e9a31
Fix whitespace linting
shethj Aug 21, 2025
8132088
Update implementation and add unit tests
shethj Aug 21, 2025
8a22e01
Remove redundant tests
shethj Aug 21, 2025
6b5c48c
Update test description
shethj Aug 21, 2025
ac9a16d
Update hbs templates to include hybridAuthEnabled
shethj Aug 21, 2025
0da9002
CI trigger
shethj Aug 21, 2025
c487d6c
CI trigger
shethj Aug 21, 2025
1611a5b
Merge pull request #3151 from SalesforceCommerceCloud/hotfix/skip-del…
shethj Aug 21, 2025
0350c98
Refactor update MRT target
shethj Aug 22, 2025
3aa0797
Fix incorrect project slug
shethj Aug 22, 2025
c639d93
Fix filename
shethj Aug 22, 2025
31a7463
Remove console.log
shethj Aug 22, 2025
677bf81
Update tests and add samples
shethj Aug 22, 2025
7f4cbd9
FIx linting
shethj Aug 22, 2025
a5edc29
Add dotenv to e2e-scripts package.json
shethj Aug 22, 2025
b69fb2f
@W-19265242@ Configurable base paths for /mobify routes (PWA Kit 3.12…
vcua-mobify Aug 22, 2025
06c7fcf
Merge pull request #3088 from SalesforceCommerceCloud/feature/ci-upda…
shethj Aug 22, 2025
bed41b5
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 23, 2025
7c8c371
Link test runs to acquired MRT target
shethj Aug 23, 2025
1054f99
Merge branch 'feature/ci-setup-env' into feature/ci-link-test-mrt-target
shethj Aug 23, 2025
b27664d
Don't pass cloud origin to create_mrt
shethj Aug 23, 2025
cf6fa40
Update project slug
shethj Aug 23, 2025
4aa78a0
Restrict test runs to .spec.js files
shethj Aug 23, 2025
a2ed63c
Parallelize test runs for e2e and a11y
shethj Aug 23, 2025
026adf0
Parallelize only the test runs
shethj Aug 23, 2025
7f568bb
Revert parallel runs
shethj Aug 23, 2025
72225a1
Run playwright tests in parallel
shethj Aug 23, 2025
29b38ad
Optimize test run
shethj Aug 23, 2025
a409411
Optimize playwright browser installs
shethj Aug 23, 2025
0533585
Optimize test run
shethj Aug 23, 2025
3df07b1
Fix linting
shethj Aug 23, 2025
da19362
Rename job
shethj Aug 23, 2025
800ae4c
Clean up test run command
shethj Aug 23, 2025
e067d92
Document parallel runs
shethj Aug 23, 2025
93c5ba1
Add docs for playwright workers
shethj Aug 23, 2025
a5f47d8
Update prettier settings
shethj Aug 23, 2025
faa184b
Clean up comments
shethj Aug 23, 2025
f117a42
Fix playwright test command
shethj Aug 23, 2025
e7b1768
Fix test run command
shethj Aug 23, 2025
a56693f
commerce-sdk-react v4 - Remove deprecated properties + fix private cl…
vcua-mobify Aug 25, 2025
4f6a45f
Update a11y snapshots to include unique landmark for toasts
shethj Aug 25, 2025
ddb7859
Revert peridot from a11y snapshot
shethj Aug 25, 2025
49ee875
Revert MRT flag
shethj Aug 25, 2025
deb3091
Feat: Consume new OAS Isomorphic SDK (@W-19105545@) (#2879)
joeluong-sfcc Aug 25, 2025
2427469
Exit workflow if app validation fails
shethj Aug 25, 2025
8de8b88
Fix docs
shethj Aug 25, 2025
4a96805
Fix project key
shethj Aug 25, 2025
337867e
Merge branch 'develop' into bugfix/a11y-snapshot
shethj Aug 25, 2025
05ba240
Merge pull request #3167 from SalesforceCommerceCloud/feature/ci-link…
shethj Aug 26, 2025
5a33717
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 26, 2025
585a109
Merge pull request #3180 from SalesforceCommerceCloud/bugfix/a11y-sna…
shethj Aug 26, 2025
b7468b2
Merge branch 'develop' into feature/ci-setup-env
shethj Aug 26, 2025
2b000eb
Merge pull request #2987 from SalesforceCommerceCloud/feature/ci-setu…
shethj Aug 26, 2025
a93ba81
[CI workflow] Send Slack notification to multiple channels (@W-194328…
vmarta Aug 26, 2025
5ea2193
Inject sfdc_user_agent request header into all SCAPI requests (@W-184…
adamraya Aug 26, 2025
f404a4b
Bump max bundle size (#3191)
shauryemahajanSF Aug 27, 2025
60d9a47
@W-18891305 MULTISHIP merge to develop (#3056)
patricksullivansf Aug 27, 2025
db85985
@W-19442561 - Fix Incorrectly Disabled Continue to Shipping Method Bu…
shauryemahajanSF Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/actions/e2e_acquire_mrt_target/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: e2e_acquire_mrt_target
description: Acquire MRT Target from pool of available targets in the MRT staging org.
inputs:
BRANCH:
description: 'GitHub branch name from workflow invoking this action'
required: false
RUN_ID:
description: 'GitHub workflow run ID from workflow invoking this action'
required: true
PR_NUMBER:
description: 'GitHub PR number from workflow invoking this action'
required: false
MAX_RETRIES:
description: 'Maximum retry attempts to acquire MRT target'
required: false
default: '3'
RETRY_DELAY:
description: 'Delay between retries in milliseconds'
required: false
default: '10000'

runs:
using: composite
steps:
- name: Acquire MRT Target
id: acquire_mrt_target
shell: bash
run: |-
set -e
cmd="node e2e/scripts/mrt-target-manager.js acquire --run-id ${{inputs.RUN_ID}} --max-retries ${{inputs.MAX_RETRIES}} --retry-delay ${{inputs.RETRY_DELAY}}"
if [ -n "${{inputs.PR_NUMBER}}" ]; then
cmd="$cmd --pr-number ${{inputs.PR_NUMBER}}"
elif [ -n "${{inputs.BRANCH}}" ]; then
cmd="$cmd --branch ${{inputs.BRANCH}}"
fi
eval $cmd
20 changes: 20 additions & 0 deletions .github/actions/e2e_release_mrt_target/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: e2e_release_mrt_target
description: Release MRT Target back to pool of available targets in the MRT staging org.
inputs:
SLUG:
description: 'MRT target slug'
required: true
MAX_RETRIES:
description: 'Maximum retry attempts to release MRT target'
required: false
default: '3'
RETRY_DELAY:
description: 'Delay between retries in milliseconds'
required: false
default: '10000'

runs:
using: node20 # Only 'node12', 'node16', 'node20' or 'node24' are supported.
main: dist/main.js
post: dist/post.js
post-if: always()
22 changes: 22 additions & 0 deletions .github/actions/e2e_release_mrt_target/dist/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2025, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

/**
* @file main.js
* @description Arms the post-release cleanup for MRT targets in CI.
*
* Intentionally empty. This file just needs to exist. Post step will read INPUT_DETAILS_FILE and perform release.
*
* Why:
* - GitHub Actions post steps execute even when a job fails or is manually cancelled,
* providing best-effort cleanup of leased resources.
* - Keeping the actual release in post.js avoids releasing too early while the job
* is still running and centralizes all teardown logic at job end.
*
* See also:
* - post.js (performs the actual release using the saved inputs)
*/
48 changes: 48 additions & 0 deletions .github/actions/e2e_release_mrt_target/dist/post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2025, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

/**
* @file post.js
* @description Performs the actual release of the MRT target back to the pool of available targets in the MRT staging org.
* This step is executed even when a job fails or is manually cancelled, providing best-effort cleanup of leased resources.
* This step is executed after the main step in the workflow.
*/
const fs = require('fs')
const path = require('path')
const {spawnSync} = require('child_process')
const config = require('../../../../e2e/config.js')

;(async () => {
try {
const workspace = process.env.GITHUB_WORKSPACE || process.cwd()
const detailsFile = config.MRT_TARGET_DETAILS_FILE
const absDetails = path.resolve(workspace, detailsFile)
console.log(`Reading MRT target details from ${absDetails}`)
if (!fs.existsSync(absDetails)) {
console.log(`No details file at ${absDetails}. Skipping release.`)
return
}

const details = JSON.parse(fs.readFileSync(absDetails, 'utf8'))
console.log(`Details: ${JSON.stringify(details)}`)
const slug = details && details.slug
if (!slug) {
console.log('No slug found in details file. Skipping release.')
return
}

const cli = path.resolve(workspace, 'e2e/scripts/mrt-target-manager.js')
console.log(`Releasing MRT target: ${slug}`)
const res = spawnSync('node', [cli, 'release', slug], {stdio: 'inherit', cwd: workspace})

if (res.status !== 0) {
console.log(`Release exited with status ${res.status}.`)
}
} catch (e) {
console.log(`Release step error: ${e.message}`)
}
})()
1 change: 1 addition & 0 deletions .github/actions/e2e_validate_generated_app/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ runs:
steps:
- name: Validate generated project
run: |
set -e
COMMAND="node e2e/scripts/validate-generated-project.js ${{ inputs.PROJECT_KEY }}"
if [[ -n "${{ inputs.TEMPLATE_VERSION }}" ]]; then
COMMAND="$COMMAND --templateVersion ${{ inputs.TEMPLATE_VERSION }}"
Expand Down
56 changes: 28 additions & 28 deletions .github/actions/push_to_mrt/action.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: push_to_mrt
inputs:
CWD:
description: Project directory
default: ${{ github.workspace }}
TARGET:
description: MRT target environment
FLAGS:
description: The rest of the flags for the push command
PROJECT:
description: MRT target project
default: "scaffold-pwa"
MESSAGE:
description: Bundle message / name
default: "build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
CLOUD_ORIGIN:
description: 'MRT Cloud origin'
default: 'https://cloud.mobify.com'
CREDENTIALS_FILE_PATH:
description: 'Path to the credentials file'
default: '~/.mobify'
CWD:
description: Project directory
default: ${{ github.workspace }}
TARGET:
description: MRT target environment
FLAGS:
description: The rest of the flags for the push command
PROJECT:
description: MRT target project
default: 'scaffold-pwa'
MESSAGE:
description: Bundle message / name
default: 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})'
CLOUD_ORIGIN:
description: MRT Cloud origin
default: 'https://cloud.mobify.com'
CREDENTIALS_FILE_PATH:
description: 'Path to the credentials file'
default: '~/.mobify'
runs:
using: composite
steps:
- name: Push Bundle to MRT
run: |-
cd ${{ inputs.CWD }}
if [[ ${{ inputs.TARGET }} ]]; then
npm run push -- --projectSlug ${{ inputs.PROJECT }} --message "${{ inputs.MESSAGE }}" --target ${{ inputs.TARGET }} --cloud-origin ${{ inputs.CLOUD_ORIGIN }} --credentialsFile ${{ inputs.CREDENTIALS_FILE_PATH }} ${{ inputs.FLAGS }}
fi
shell: bash
using: composite
steps:
- name: Push Bundle to MRT
run: |-
cd ${{ inputs.CWD }}
if [[ ${{ inputs.TARGET }} ]]; then
npm run push -- --projectSlug ${{ inputs.PROJECT }} --message "${{ inputs.MESSAGE }}" --target ${{ inputs.TARGET }} --cloud-origin ${{ inputs.CLOUD_ORIGIN }} --credentialsFile ${{ inputs.CREDENTIALS_FILE_PATH }} ${{ inputs.FLAGS }}
fi
shell: bash
63 changes: 63 additions & 0 deletions .github/actions/update_mrt_target/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: update_mrt_target
description: Update a MRT target environment. This endpoint automatically re-deploys the current bundle if any of the SSR-related properties are changed.
inputs:
PROJECT_SLUG:
description: 'MRT Project slug'
required: true
TARGET_SLUG:
description: 'MRT Target slug'
required: true
MOBIFY_API_KEY:
description: 'Mobify API key'
required: true
CLOUD_ORIGIN:
description: 'MRT Cloud origin'
required: false
default: 'https://cloud.mobify.com'
MRT_TARGET_SETTINGS_FILE_PATH:
description: 'Path to .env file containing MRT target environment settings'
required: false
MRT_TARGET_VARS_FILE_PATH:
description: 'Path to .env file containing environment variables to be set on the MRT target environment'
required: false

runs:
using: composite
steps:
- name: Update MRT Target Settings
id: update_mrt_target_settings
if: ${{ inputs.MRT_TARGET_SETTINGS_FILE_PATH != '' }}
shell: bash
run: |-
set -e

# Build arguments for the Node.js script
ARGS=(
"--project-slug" "${{ inputs.PROJECT_SLUG }}"
"--target-slug" "${{ inputs.TARGET_SLUG }}"
"--mobify-api-key" "${{ inputs.MOBIFY_API_KEY }}"
"--cloud-origin" "${{ inputs.CLOUD_ORIGIN }}"
"--env-file" "${{ inputs.MRT_TARGET_SETTINGS_FILE_PATH }}"
)

# Run the Node.js script
node e2e/scripts/update-mrt-target.js target "${ARGS[@]}"

- name: Update MRT Target Environment Variables
id: update_mrt_target_env_vars
if: ${{ inputs.MRT_TARGET_VARS_FILE_PATH != '' }}
shell: bash
run: |-
set -e

# Build arguments for the Node.js script
ARGS=(
"--project-slug" "${{ inputs.PROJECT_SLUG }}"
"--target-slug" "${{ inputs.TARGET_SLUG }}"
"--mobify-api-key" "${{ inputs.MOBIFY_API_KEY }}"
"--env-file" "${{ inputs.MRT_TARGET_VARS_FILE_PATH }}"
"--cloud-origin" "${{ inputs.CLOUD_ORIGIN }}"
)

# Run the Node.js script
node e2e/scripts/update-mrt-target.js env-var "${ARGS[@]}"
45 changes: 29 additions & 16 deletions .github/workflows/agent_checkout_rebase_action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# .github/workflows/rebase-express-payments.yml

name: 'Auto Rebase adyenExpressPaymentsDreamForceTestAlertBranch'
name: 'Auto Rebase adyenExpressPayments'

# This action will trigger on every push to the develop branch.
# This action will trigger on the creation of new preview release tags
on:
push:
branches:
- develop
tags:
- '*-preview'
workflow_dispatch:

permissions:
contents: write

jobs:
rebase:
name: Rebase adyenExpressPaymentsDreamForceTestAlertBranch on develop
name: Rebase adyenExpressPayments on preview release
runs-on: ubuntu-latest

steps:
Expand All @@ -34,9 +37,9 @@ jobs:
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'

# Step 4: Switch to the adyenExpressPaymentsDreamForceTestAlertBranch branch.
- name: Switch to adyenExpressPaymentsDreamForceTestAlertBranch branch
run: git checkout adyenExpressPaymentsDreamForceTestAlertBranch
# Step 4: Switch to the adyenExpressPayments branch.
- name: Switch to adyenExpressPayments branch
run: git checkout adyenExpressPayments

# Step 5: Delete all package-lock.json files before the rebase.
- name: Delete package-lock.json files
Expand All @@ -46,15 +49,19 @@ jobs:
# The 'if' statement prevents an error if no lock files were found.
if [[ -n $(git status -s) ]]; then
git add .
git commit -m "chore: remove package-lock.json files before rebase"
git commit -m "chore: remove package-lock.json files before rebase and regenerating after"
else
echo "No package-lock.json files found to delete."
fi

# Step 6: Attempt to rebase the branch. The job will fail if this step fails.
- name: Rebase adyenExpressPaymentsDreamForceTestAlertBranch with develop
# Step 6: Attempt to rebase the branch. If this step fails, we abort the rebase and
# return the branch to its original state
- name: Rebase adyenExpressPayments with develop
run: |
if ! git rebase origin/develop; then
TRIGGERING_TAG="${{ github.ref_name }}"
echo "🔄 Rebasing branch 'adyenExpressPayments' onto tag '$TRIGGERING_TAG'"

if ! git rebase $TRIGGERING_TAG; then
echo "Rebase failed due to conflicts. Aborting."
git rebase --abort
exit 1
Expand All @@ -63,11 +70,18 @@ jobs:
# Step 7: Install dependencies after a successful rebase.
# The '--yes' flag for lerna is crucial for non-interactive environments.
- name: Install Dependencies
run: npx lerna clean --yes && npm i
run: |
if ! npx lerna clean --yes && npm i; then
echo "Generating package-lock files after rebase failed!"
exit 1
fi

# Step 8: Push the changes only if all previous steps were successful.
- name: Push Changes
run: git push origin adyenExpressPaymentsDreamForceTestAlertBranch --force-with-lease
run: |
git add .
git commit --amend --no-edit
git push origin adyenExpressPayments --force-with-lease

# Step 9: This notification step will run if any of the above steps fail.
- name: Notify on Failure
Expand All @@ -77,8 +91,7 @@ jobs:
# The channel or user ID to send the notification to.
channel-id: '${{ secrets.AGENT_CHECKOUT_ALERT_SLACK_CHANNEL_ID }}'
# A custom message for the Slack notification.
slack-message: "🚨 Automatic rebase of `adyenExpressPaymentsDreamForceTestAlertBranch` failed. Manual intervention is required. Link to failed action: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
slack-message: "🚨 Automatic rebase of `adyenExpressPayments` failed. Manual intervention is required. Link to failed action: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
# You must store your Slack Bot Token as a secret in your repository settings.
SLACK_BOT_TOKEN: '${{ secrets.AGENT_CHECKOUT_SLACK_BOT_TOKEN }}'
# Forcing a re-index
Loading
Loading