Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svierk/sfdx-data-import
💾 Github composite action for uploading Salesforce data based on CSV (Bulk API 2.0) or JSON (sObject Tree)
https://github.com/svierk/sfdx-data-import
composite-action github-actions salesforce sfdx sfdx-cli
Last synced: about 1 month ago
JSON representation
💾 Github composite action for uploading Salesforce data based on CSV (Bulk API 2.0) or JSON (sObject Tree)
- Host: GitHub
- URL: https://github.com/svierk/sfdx-data-import
- Owner: svierk
- License: mit
- Created: 2024-03-18T16:41:11.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-25T09:42:11.000Z (8 months ago)
- Last Synced: 2024-05-02T04:18:56.944Z (7 months ago)
- Topics: composite-action, github-actions, salesforce, sfdx, sfdx-cli
- Homepage: https://github.com/marketplace/actions/sfdx-data-import
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💾 SFDX Data Import
This repository implements a simple GitHub composite action for uploading records to any kind of Salesforce org from within CI/CD automations based on CSV (Bulk API 2.0) or JSON (sObject Tree) format.
## Usage
After installing the SF CLI and authorizing the relevant org in your GitHub workflow, data can be imported using this action as follows:
```
jobs:
validation:
name: Validation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4- name: Select Node Version
uses: svierk/get-node-version@main- name: Install Dependencies
run: npm ci- name: Install SF CLI
uses: svierk/sfdx-cli-setup@main- name: Salesforce Org Login
uses: svierk/sfdx-login@main
with:
sfdx-url: ${{ secrets.SFDX_AUTH_URL }}
alias: awesome-org- name: CSV Data Import
uses: svierk/sfdx-data-import@main
with:
file-path: './data/accounts.csv'
object-type: 'Account'
external-id: 'Id'
target-org: awesome-org- name: JSON Data Import
uses: svierk/sfdx-data-import@main
with:
file-path: './data/accounts.json,./data/contacts.json'
api-version: '59.0'
```The following actions were also used in the example workflow to create the prerequisites for the data import:
- [Get Node Version](https://github.com/svierk/get-node-version) | Pulls Node.js version to be used from the _package.json_ of the project
- [SFDX CLI Setup](https://github.com/svierk/sfdx-cli-setup) | Installs the Salesforce CLI and related plugins
- [SFDX Login](https://github.com/svierk/sfdx-login) | Handles Salesforce login using a Salesforce DX authorization URLOf course, the data import action can be used flexibly and the respective approach can vary.
## References
The data import options supported by this GitHub composite action can be found in the Salesforce CLI Command Reference here:
- [data import tree](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_data_commands_unified.htm#cli_reference_data_import_tree_unified) (JSON format)
- [data upsert bulk](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_data_commands_unified.htm#cli_reference_data_upsert_bulk_unified) (CSV format)## Releases
Latest release notes can be found on the [release page](https://github.com/svierk/sfdx-data-import/releases).
## License
The scripts and documentation in this project are released under the [MIT License](https://github.com/svierk/sfdx-data-import/blob/main/LICENSE).