Committing to GitHub
This page explains how to push your portal configuration to GitHub.
What Gets Committed?
When you commit to GitHub, APD pushes:
| Component | Folder | Notes |
|---|---|---|
| Actions | Tables/Table_APD Action.json |
All action definitions |
| DataItem configs | Tables/Table_APD Action DataItem*.json |
Table and field mappings |
| DataItem filters | Tables/Table_APD DataItem Filter 2.json |
Filter configurations |
| Security Profiles | Tables/Table_APD Security Profile.json |
Profile definitions |
| Security Filters | Tables/Table_APD Security Setup.json |
Table-level security |
| Content Types | Tables/Table_APD Content Type.json |
Content categorization |
| Content metadata | Tables/Table_APD Page Content.json |
Content properties |
| Templates | Templates/* |
HTML template files |
| Content | Content/{lang}/*.md or .html |
Markdown/HTML content |
How to Commit
From APD Setup Page
- Open the Advanced Portal Designer menu page (search for it in Tell Me) and click Setup
- Click Commit to GitHub in the action bar
- Confirm the prompt ("Commit everything to branch {branch} in GitHub repository {repo}?")
- A second dialog (
Commit to GitHub) prompts for the Commit message — edit the default or accept it - Wait for the operation to complete
- Success message: "GitHub updated!"
Commit Process
When you commit, APD:
- Collects all portal configuration data
- Serializes tables to JSON format
- Exports templates as individual files
- Exports content with appropriate extensions
- Creates a single commit with all changes
- Pushes to the configured branch
Commit Details
Commit Message
APD prompts you for the commit message before each push. The default message — pre-filled in the dialog — is:
Commit from Business Central
Edit the field to write something meaningful (e.g. "Add customer dashboard action") before confirming. The dialog is the Commit to GitHub standard dialog page; cancelling it aborts the push with Commit cancelled..
Automatic Handling
APD automatically:
- Creates new files for new items
- Updates existing files for changes
- Deletes template files that no longer exist in BC
Note: Table JSON files are never deleted, even if empty. Only template files are deleted when removed from Business Central.
File Formats
Table JSON Structure
Table data is stored as JSON with field references:
{
"Table": "APD Action",
"No": 70310502,
"Records": [
{
"F1": {"value": "HOME"},
"F2": {"value": "Home Page"},
"F3": {"value": 0},
"F10": {"value": "home"}
}
]
}
Field numbers (F1, F2, etc.) correspond to Business Central field IDs.
Template Files
Templates are stored as plain HTML/text:
Templates/home
Templates/header
Templates/footer
Templates/ENU/welcome
Language-specific templates are in language code subfolders.
Content Files
Content uses file extensions based on style:
Content/0/privacy-policy.md # Markdown (language 0)
Content/0/terms.html # HTML (language 0)
Content/1033/welcome.md # Markdown (English US)
Viewing Commits
In GitHub
After committing:
- Go to your GitHub repository
- Click on Commits or navigate to your branch
- See the latest commit "Commit from Business Central"
- Click the commit to see changed files
Comparing Changes
Use GitHub's diff view to:
- See exactly what changed
- Compare with previous versions
- Review template modifications
Best Practices
Commit Regularly
- Commit after significant changes
- Commit before major modifications
- Commit before testing in other environments
Review Before Commit
Before committing:
- Verify all actions compile correctly
- Test templates in the portal
- Ensure content is finalized
Write Meaningful Commit Messages
Use the commit-message dialog to describe what changed instead of accepting the default:
- One short sentence summarising the change ("Add CUSTOMER-LIST action and template")
- Reference a GitHub issue when applicable
- Avoid generic messages like "Updates" or "Fixed stuff"
Handling Errors
"Cannot publish to a complete empty repository"
The repository needs at least one file:
- Go to your GitHub repository
- Add a README.md file through the web interface
- Try committing again
"Your GitHub setup is incomplete"
Verify all fields are filled:
- GitHub Account Name
- GitHub Personal Token
- GitHub Repository
- GitHub Branch
"GitHub Connection failed, error (401)"
Authentication failed:
- Verify your token hasn't expired
- Generate a new token if needed
- Update the GitHub Personal Token field
"GitHub Connection failed, error (403)"
Permission denied:
- Check token permissions (needs
reposcope) - Verify you have write access to the repository
- Check if branch protection prevents direct pushes
"Failed to update GitHub, error: ..."
General error:
- Review the error message details
- Check GitHub status
- Verify repository and branch exist
- Ensure branch is not protected against direct pushes
What's NOT Committed
The following are never stored in GitHub:
| Item | Reason |
|---|---|
| User records | Security - contains passwords |
| Session data | Transient data |
| License info | Environment-specific |
| Setup configuration | Contains sensitive settings |
| GitHub credentials | Security |
Overwriting Warning
Important: Commit operations overwrite files in GitHub.
If you have local changes in GitHub that haven't been pulled:
- Those changes may be overwritten
- Consider pulling first if uncertain
- Use branches to protect work in progress