Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Pull Request to Master

on:
pull_request:
branches: [master]

jobs:
validate_pull_request:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Salesforce CLI
run: |
wget https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz
mkdir -p ~/cli/sf
tar xJf sf-linux-x64.tar.xz -C ~/cli/sf --strip-components 1
echo "$HOME/cli/sf/bin" >> $GITHUB_PATH

- name: Populate auth file
shell: bash
run: 'echo ${{secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt'

- name: Authenticate Dev Hub
run: 'sf org login sfdx-url --sfdx-url-file ./DEVHUB_SFDX_URL.txt --alias devhub --set-default-dev-hub'

- name: Create scratch org
id: create_org
run: 'sf org create scratch --definition-file config/project-scratch-def.json --alias ci_scratch --set-default --duration-days 1'

- name: Push source to scratch org
run: 'sf project deploy start --wait 10'

- name: Delete scratch org
if: ${{ steps.create_org.outcome == 'success' }}
run: 'sf org delete scratch --no-prompt --target-org ci_scratch'