Skip to content

Commit 8ba412b

Browse files
committed
Initial commit
0 parents  commit 8ba412b

File tree

12 files changed

+1175
-0
lines changed

12 files changed

+1175
-0
lines changed

.github/workflows/test.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Test Action
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-minimal:
12+
name: Test Minimal Setup
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'rdbumstead/setup-salesforce-action'
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Test Minimal
21+
uses: ./
22+
with:
23+
jwt_key: ${{ secrets.SFDX_JWT_KEY }}
24+
client_id: ${{ secrets.SFDX_CLIENT_ID }}
25+
username: ${{ vars.SFDX_USERNAME }}
26+
27+
- name: Verify
28+
run: |
29+
sf --version
30+
sf org display
31+
32+
test-with-plugins:
33+
name: Test with Plugins
34+
runs-on: ubuntu-latest
35+
if: github.repository == 'rdbumstead/setup-salesforce-action'
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
41+
- name: Test with Plugins
42+
uses: ./
43+
with:
44+
jwt_key: ${{ secrets.SFDX_JWT_KEY }}
45+
client_id: ${{ secrets.SFDX_CLIENT_ID }}
46+
username: ${{ vars.SFDX_USERNAME }}
47+
install_scanner: "true"
48+
install_delta: "true"
49+
50+
- name: Verify Plugins
51+
run: |
52+
sf plugins | grep sfdx-git-delta
53+
sf plugins | grep code-analyzer
54+
55+
test-dev-tools:
56+
name: Test Dev Tools
57+
runs-on: ubuntu-latest
58+
if: github.repository == 'rdbumstead/setup-salesforce-action'
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Test Dev Tools
65+
uses: ./
66+
with:
67+
jwt_key: ${{ secrets.SFDX_JWT_KEY }}
68+
client_id: ${{ secrets.SFDX_CLIENT_ID }}
69+
username: ${{ vars.SFDX_USERNAME }}
70+
install_prettier: "true"
71+
install_eslint: "true"
72+
install_lwc_jest: "true"
73+
74+
- name: Verify Tools
75+
run: |
76+
prettier --version
77+
eslint --version
78+
npm list -g @salesforce/sfdx-lwc-jest
79+
80+
test-skip-auth:
81+
name: Test Skip Auth
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v4
87+
88+
- name: Test Skip Auth
89+
uses: ./
90+
with:
91+
jwt_key: "dummy"
92+
client_id: "dummy"
93+
username: "dummy"
94+
skip_auth: "true"
95+
install_delta: "true"
96+
97+
- name: Verify CLI Only
98+
run: |
99+
sf --version
100+
sf plugins | grep sfdx-git-delta

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# OS
2+
.DS_Store
3+
Thumbs.db
4+
*.swp
5+
*.swo
6+
7+
# IDE
8+
.vscode/
9+
.idea/
10+
*.iml
11+
12+
# Salesforce
13+
.sf/
14+
.sfdx/
15+
*.key
16+
jwt.key
17+
server.key
18+
server.crt
19+
server.csr
20+
21+
# Node
22+
node_modules/
23+
npm-debug.log
24+
yarn-error.log
25+
26+
# Test
27+
test-results/
28+
coverage/
29+
*.log

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-01-12
9+
10+
### Added
11+
12+
- Initial release of Setup Salesforce CLI Action
13+
- JWT-based authentication for Salesforce orgs
14+
- Automatic Salesforce CLI installation with Node.js version control
15+
- Intelligent caching for CLI and plugins (3-5x speedup)
16+
- Optional sfdx-git-delta plugin installation (default: off)
17+
- Optional @salesforce/plugin-code-analyzer installation (default: off)
18+
- Optional Prettier installation with Salesforce plugins (default: off)
19+
- Optional ESLint installation with Salesforce plugins (default: off)
20+
- Optional sfdx-lwc-jest installation for LWC testing (default: off)
21+
- Dev Hub configuration support
22+
- Skip authentication option for CLI-only setups
23+
- Automatic org type detection and environment variables
24+
- Composite action pattern for easy reuse
25+
26+
### Fixed
27+
28+
- **Cross-platform compatibility**: Removed `sudo apt-get` dependence to support Windows and macOS runners.
29+
- **Security improvement**: Implemented `trap` for guaranteed JWT key cleanup on success or failure.
30+
31+
### Features
32+
33+
- Zero-configuration minimal setup (CLI + auth only)
34+
- All plugins and tools optional (install only what you need)
35+
- Secure JWT authentication with automatic key cleanup
36+
- Smart caching with configuration-aware cache keys
37+
- Plugin version checking to avoid redundant installs
38+
- Comprehensive error handling and validation
39+
- Support for both standard orgs and Dev Hubs
40+
- Skip auth capability for custom authentication flows
41+
42+
### Performance
43+
44+
- Minimal setup: 20 seconds (cached)
45+
- Recommended setup (delta + scanner): 35 seconds (cached)
46+
- Full stack setup (all tools): 45 seconds (cached)
47+
- ~95% cache hit rate in typical CI/CD workflows
48+
- Conditional plugin installation to skip unnecessary steps
49+
50+
### Documentation
51+
52+
- Comprehensive README with multiple use case examples
53+
- Step-by-step Connected App setup guide
54+
- **Documentation**: Replaced troubleshooting and report bug emojis for better visual clarity.
55+
- Performance comparison tables
56+
- Complete input reference
57+
58+
[1.0.0]: https://github.com/rdbumstead/setup-salesforce-action/releases/tag/v1.0.0

CONTRIBUTING.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Contributing to Setup Salesforce CLI Action
2+
3+
Thank you for your interest in contributing!
4+
5+
## How to Contribute
6+
7+
### Reporting Bugs
8+
9+
1. Check existing issues
10+
2. Create new issue with:
11+
- Clear title
12+
- Steps to reproduce
13+
- Expected vs actual behavior
14+
- Environment details
15+
- Sanitized workflow logs
16+
17+
### Suggesting Features
18+
19+
1. Open issue labeled `enhancement`
20+
2. Describe:
21+
- Problem you're solving
22+
- Proposed solution
23+
- Alternatives considered
24+
- Impact on existing users
25+
26+
### Pull Requests
27+
28+
1. Fork repository
29+
2. Create feature branch: `git checkout -b feature/your-feature`
30+
3. Make changes following existing patterns
31+
4. Test thoroughly
32+
5. Commit: `git commit -m "feat: add custom CLI version support"`
33+
6. Push and create PR
34+
35+
## Development Guidelines
36+
37+
### Code Style
38+
39+
- Use clear variable names
40+
- Add comments for complex logic
41+
- Keep steps focused
42+
- Use `set -e` for error handling
43+
44+
### Testing Checklist
45+
46+
Before submitting PR:
47+
48+
- [ ] Test with scanner enabled/disabled
49+
- [ ] Test with delta enabled/disabled
50+
- [ ] Test with all dev tools enabled
51+
- [ ] Test minimal setup (with auth)
52+
- [ ] Test CLI-only setup (`skip_auth: 'true'` without jwt_key, client_id, username)
53+
- [ ] Test with Dev Hub
54+
- [ ] Test cache hit scenario
55+
- [ ] Test cache miss scenario
56+
57+
### Documentation
58+
59+
Update docs for:
60+
61+
- New inputs/outputs
62+
- Changed behavior
63+
- New use cases
64+
- Breaking changes
65+
66+
### Commit Messages
67+
68+
type(scope): short description
69+
70+
Longer description if needed
71+
72+
Fixes #123
73+
74+
**Types:** feat, fix, docs, chore, refactor, perf
75+
76+
## Code of Conduct
77+
78+
- Be respectful and inclusive
79+
- Welcome newcomers
80+
- Accept constructive criticism
81+
- Focus on what's best for the community
82+
83+
## Questions?
84+
85+
- Open issue labeled `question`
86+
- Email: ryan@ryanbumstead.com
87+
88+
## License
89+
90+
By contributing, you agree your contributions will be licensed under MIT License.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Ryan Bumstead
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)