it is not quite clear to me what the structure of the yml file is for different branches.
I need the possibility to run different validation jobs per branch.
If I create a PullRequest against stage, the validation job of develop still runs.
image: node:18
pipelines:
pull-requests:
'**->develop':
- step:
name: "Validate for PR to develop"
caches:
- node
script:
- echo "Installing Salesforce CLI..."
- echo "Installing sfdx git delta plugin..."
- echo y | sf plugins:install sfdx-git-delta
- sf plugins
- echo "Authenticating with Salesforce using authURL for develop (PR)..."
- echo "$SF_AUTH_URL_DEV" > authfile.txt
- sfdx auth:sfdxurl:store --sfdx-url-file authfile.txt --setalias devOrg --setdefaultusername
- echo "Creating delta packages for new, modified or deleted metadata..."
- mkdir -p changed-sources
- sf sgd:source:delta --to "HEAD" --from "origin/develop" --output changed-sources/ --generate-delta --source force-app/ -i .forceignore
- chmod +x ./deployment/script/*.sh
- echo "Running validation script for develop..."
- ./deployment/script/validate.sh devOrg
'**->stage':
- step:
name: "Validate for PR to stage"
caches:
- node
script:
- echo "Installing Salesforce CLI..."
- echo "Installing sfdx git delta plugin..."
- echo y | sf plugins:install sfdx-git-delta
- sf plugins
- echo "Authenticating with Salesforce using authURL for stage (PR)..."
- echo "$SF_AUTH_URL_STAGE" > authfile.txt
- sfdx auth:sfdxurl:store --sfdx-url-file authfile.txt --setalias stageOrg --setdefaultusername
- echo "Creating delta packages for new, modified or deleted metadata..."
- mkdir -p changed-sources
- sf sgd:source:delta --to "HEAD" --from "origin/stage" --output changed-sources/ --generate-delta --source force-app/ -i .forceignore
- chmod +x ./deployment/script/*.sh
- echo "Running validation script for stage..."
- ./deployment/script/validate.sh stageOrg