Coder Social home page Coder Social logo

salesforcedx-actions's Introduction

salesforcedx-actions

(Unofficial) GitHub Actions for SalesforceDX using the Salesforce CLI.

It passes the contents of the arg parameter to the underlying Salesforce CLI in the Docker container.

Examples

Authenticating with force:auth:sfdxurl:store

steps:
  - name: 'Populate auth file with SFDX_URL secret'
    shell: bash
    run: 'echo ${{ secrets.DEV_HUB_SFDXURL}} > ./SFDX_URL_STORE.txt'
  - name: 'Authenticate against dev hub'
    uses: forcedotcom/salesforcedx-actions@master
    with:
      args: 'force:auth:sfdxurl:store --sfdxurlfile=./SFDX_URL_STORE.txt --setalias=devhub --setdefaultdevhubusername'

Create a scratch org with force:org:create

steps:
  - name: 'Create scratch org'
    uses: forcedotcom/salesforcedx-actions@master
    with:
      args: 'force:org:create --definitionfile=config/project-scratch-def.json --setalias=scratch-org --setdefaultusername'

Push source with force:source:push

steps:
  # Authenticate first
  - uses: actions/checkout@v1
  - name: 'Push source'
    uses: forcedotcom/salesforcedx-actions@master
    with:
      args: 'force:source:push'

Clean up scratch org with force:org:delete

steps:
  - name: 'Clean up scratch org'
    uses: forcedotcom/salesforcedx-actions@master
    with:
      args: 'force:org:delete --targetusername=scratch-org --noprompt'

License

The Dockerfile and associated scripts and documentation in this project are released under the BSD-3 License.

Container images built with this project include third party materials. See THIRD_PARTY_NOTICE.md for details.

salesforcedx-actions's People

Contributors

mshanemc avatar svc-scm avatar vazexqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesforcedx-actions's Issues

manifest for salesforce/salesforcedx:latest not found

Since a couple of days ago, I am getting this error when using the action to deploy to salesforce

Build container for action use: '/home/runner/work/_actions/forcedotcom/salesforcedx-actions/master/Dockerfile'.
  /usr/bin/docker build -t da7a08:95128f6515194e14824f2d8f44c42564 -f
"/home/runner/work/_actions/forcedotcom/salesforcedx-actions/master/Dockerfile" 
"/home/runner/work/_actions/forcedotcom/salesforcedx-actions/master"
  manifest for salesforce/salesforcedx:latest not found: manifest unknown: manifest unknown

According to this issue in StackExchange with Docker image should be build with FROM salesforce/salesforcedx:latest-rc-full

Can not see commands output

This is my yml file:


on: [push]

jobs:

  commit-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: 'Populate auth file with SFDX_URL secret'
        shell: bash
        run: 'echo ${{ secrets.DEV_HUB_SFDXURL}} > ./SFDX_URL_STORE.txt'
      - name: 'Display dir'
        shell: bash
        run: 'ls'
      - name: 'Authenticate against dev hub'
        uses: forcedotcom/salesforcedx-actions@master
        with:
          args: 'force:auth:sfdxurl:store --sfdxurlfile=./SFDX_URL_STORE.txt --setalias=devhub --setdefaultdevhubusername'
      - name: 'Create scratch org'
        uses: forcedotcom/salesforcedx-actions@master
        with:
          args: 'force:org:create --definitionfile=config/project-scratch-def.json --setalias=scratch-org --setdefaultusername'
      - name: 'Push source'
        uses: forcedotcom/salesforcedx-actions@master
        with:
          args: 'force:source:push -f'
      - name: 'Run unit tests'
        uses: forcedotcom/salesforcedx-actions@master
        with:
          args: 'force:apex:test:run -l RunLocalTests -w 30'
      - name: 'Delete scratch org'
        uses: forcedotcom/salesforcedx-actions@master
        with:
          args: 'force:org:delete --targetusername=scratch-org --noprompt'

When a command fails like SFDX force:push I can not see the output error.
Are there any option which I can see the output of commands?

Docker exits with code 100 when running Apex tests

First of all, thanks for this great contribution. I've successfully set up GH action on a couple of my projects and it's working fine.

However, I just bumped into an issue that I'm unable to fix. I'm setting up CI on this project.

I'm running Apex tests with this step:

# Run Apex tests in scratch org
- name: 'Run Apex tests'
  uses: forcedotcom/salesforcedx-actions@master
  with:
    args: 'force:apex:test:run -r human -w 20'

When CI runs the job, Docker systematically crashes on that step with exit code 100:

Run forcedotcom/salesforcedx-actions@master
  with:
    args: force:apex:test:run -r human -w 20
/usr/bin/docker run --name af96b4799818a4de1b4c4bb3bbbf260cff1a4b_e46a64 --label af96b4 --workdir /github/workspace --rm -e INPUT_ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/quiz-host-app/quiz-host-app":"/github/workspace" af96b4:799818a4de1b4c4bb3bbbf260cff1a4b force:apex:test:run -r human -w 20
##[error]Docker run failed with exit code 100

My tests are pretty basic (20 tests, no large volume...) and I'm able to run them locally so I don't know what's causing the issue and the error message isn't helping.
Any clue on what could be the problem?

force:source:deploy not respecting double quotes in args

Issue

I am trying to use the force:source:deploy by providing a comma separated list of file paths in which some of the file names have spaces. However when passing the double quotes in the args, I'm getting sfdx errors with unrecognized file paths due to the file name being chopped off.

Steps to reproduce

The step below assumes that authentication, default user names and GitHub outputs have been setup correctly. The following is an example of the deploy step.

- name: Deploy files
  uses: forcedotcom/salesforcedx-actions@master
    with:
      args: 'force:source:deploy -p "${{ steps.files.outputs.files-to-deploy }}" -u ${{ secrets.SALESFORCE_USERNAME }}'

This is the files-to-deploy variable

force-app/main/default/layouts/Contact-Contact Layout.layout-meta.xml, force-app/main/default/objects/Contact/Contact.object-meta.xml

Expected Outcome

Files deploy correctly to target environment. Confirmed this by doing a direct npm install with the sfdx-cli and not using the docker action.

Actual Outcome

Following is the output received.

ERROR running force:source:deploy:  Unexpected arguments: Layout.layout-meta.xml,, force-app/main/default/objects/Contact/Contact.object-meta.xml

If I'm passing in the arguments incorrectly that would be an ideal news story ๐Ÿ˜„ any help is greatly appreciated. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.