A GitHub Actions workflow for automating Epicor ERP development tasks.
Downloads Epicor packages (DLLs and C# files) from your web application and sets up a complete .NET 8 development environment in GitHub Codespaces.
- π Automated Repository Creation: Creates new repositories or updates existing ones
- π Flexible Path Support: Supports root-level projects or subfolder structures
- π¦ Package Management: Downloads and organizes DLLs and C# source files
- π οΈ .NET 8 Project Setup: Configures a complete .NET 8 console application
- π» Codespace Integration: Automatically creates or updates GitHub Codespaces
- π§ Development Ready: Pre-configured with C# extensions and tools
- A GitHub organization or personal account
- Your epicor environment accessible via URL
- Install BootStrapBill library in your environment (2023.2 or later unless you want to pull the code from the file and paste it in an older version which would also work)
- GitHub Personal Access Token (PAT) with appropriate permissions
- GitHub repository to host this workflow
- Fork this repository or copy all files to your GitHub organization
- Ensure all files maintain their directory structure:
.github/workflows/ epicor-to-codespace.yml scripts/ download-epicor.sh setup-repository.sh setup-dotnet-project.sh manage-codespace.sh .devcontainer/devcontainer.json
Navigate to your repository's Settings β Secrets and variables β Actions, and add the following secrets:
Secret Name | Description | Required | Used By |
---|---|---|---|
EPICOR_URL |
Your web application endpoint URL that returns the ZIP file (EpicorBaseURL/api/v2/efx/your_company/BootStrapBill/DownloadProject) | β | Download |
EPICOR_BASE_URL |
Base URL for Epicor API | β | Push |
EPICOR_API_KEY |
API key for authentication (if required) | Both | |
EPICOR_BASIC_AUTH |
Basic auth credentials in base64 (if required) | Both | |
GH_PAT |
GitHub Personal Access Token with repo and codespace permissions | β | Download |
WEBHOOK_URL |
Webhook URL for error notifications (optional) | β | Both |
- Go to GitHub Settings β Developer settings β Personal access tokens β Tokens (classic)
- Click "Generate new token (classic)"
- Select the following permissions:
repo
(Full control of private repositories)workflow
(Update GitHub Action workflows)codespace
(Create and manage codespaces)
- Copy the token and save it as the
GH_PAT
secret
The workflow will automatically make scripts executable, but if you need to test locally:
chmod +x scripts/*.sh
- Go to your repository on GitHub
- Click on the "Actions" tab
- Select "Epicor to Codespace Setup" workflow
- Click "Run workflow"
- Enter the repository path (e.g.,
my-epicor-project
orexisting-repo/epicor-module
) - Click "Run workflow"
# Using curl
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token YOUR_GH_PAT" \
https://api.github.com/repos/YOUR_ORG/YOUR_REPO/dispatches \
-d '{
"event_type": "epicor-setup",
"client_payload": {
"repository_path": "my-epicor-project"
}
}'
Input | Result |
---|---|
my-project |
Creates/updates repository my-project with project in root |
my-project/module1 |
Creates/updates repository my-project with project in module1 folder |
existing-repo/new-module |
Updates existing repository with new project in new-module folder |
After the workflow completes, your repository will have:
your-repo/
βββ .devcontainer/
β βββ devcontainer.json # Codespace configuration
βββ EpicorProject/ # Or in subfolder if specified
β βββ lib/ # All DLL files from Epicor
β βββ src/ # All C# source files
β βββ EpicorProject.csproj # .NET 8 project file
β βββ Program.cs # Entry point
β βββ appsettings.json # Configuration
β βββ .gitignore # Git ignore rules
βββ EpicorProject.sln # Solution file
βββ README.md # Project documentation
The workflow provides:
- Codespace URL: Direct link to open the Codespace
- Repository URL: Link to the created/updated repository
- Summary: Detailed information in GitHub Actions summary
The download script supports multiple authentication methods:
- No Authentication: If your endpoint is public
- API Key Only: Uses
X-API-Key
header - Basic Auth Only: Uses
Authorization: Basic
header - Both: Uses both API Key and Basic Auth headers
-
"Failed to create repository"
- Ensure your PAT has
repo
permissions - Check if the repository name is valid (alphanumeric, hyphens, underscores)
- Ensure your PAT has
-
"Failed to download package"
- Verify
EPICOR_URL
is correct - Check authentication credentials
- Ensure the endpoint returns a valid ZIP file
- Verify
-
"Failed to create Codespace"
- Verify PAT has
codespace
permissions - Check your Codespace usage limits
- Try with a smaller machine type
- Verify PAT has
-
"Build errors in .NET project"
- This is often expected if DLLs have dependencies
- The project will still be created and can be fixed in Codespace
- Go to Actions tab in your repository
- Click on the workflow run
- Click on the job to see detailed logs
- Check the step that failed for specific error messages
- All secrets are encrypted and never exposed in logs
- Use private repositories for sensitive code
- Regularly rotate your PAT and API keys
- Consider using GitHub Apps instead of PATs for production use
- The workflow validates input paths to prevent injection attacks
Edit scripts/setup-dotnet-project.sh
to:
- Change the project type (web, library, etc.)
- Add additional NuGet packages
- Modify the project structure
- Change framework version
Edit .devcontainer/devcontainer.json
to:
- Add more VS Code extensions
- Change the base image
- Modify system requirements
- Add additional development tools
For issues or questions:
- Check the Troubleshooting section
- Review workflow logs in GitHub Actions
- Ensure all prerequisites are met
- Verify secret values are correct
The workflow:
- Retries failed uploads (up to 3 attempts)
- Reports status for each function (SUCCESSFUL/UNSUCCESSFUL)
- Generates summary in GitHub Actions
- Sends webhook notifications on failure
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
You are free to:
- Share β copy and redistribute the material in any medium or format.
- Adapt β remix, transform, and build upon the material.
Under the following terms:
- Attribution β You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial β You may not use the material for commercial purposes.
For more details, see the LICENSE file.