View your Flagsmith Flags inside GitHub Issues and Pull Requests.
Integration Setup (SaaS)
You can either set up the integration from the Flagsmith side or from the Github side.
From Flagsmith
- In the Integrations Option in the top navigation bar, find the GitHub integration and click on 'Add Integration'.
- A window will open asking you to select the organization you belong to.
- Select the repositories and save.
- Back in the Flagsmith application, click on the 'Manage Integration' button.
- Finally, select the repository you wish to link.
From GitHub
- In GitHub, add the app from the GitHub Marketplace.
- Select your organisation.
- Select your repositories where you want install the app.
- You will be redirected back to the Flagsmith app to finish the integration setup.
- Select your Flagsmith Organisation.
- Select the Flagsmith Project you want to associate with the repository where the app was installed to create the Integration.
Integration Setup (Self-Hosted)
Creating and Configuring your GitHub App
You can create your own GitHub App by following these steps from GitHub Docs.
In the Permissions and Events section, configure the following permissions and events:
Repository permissions
- Issues: Read and write.
- Metadata: Read only (Mandatory)
- Pull requests: Read and write.
Subscribe to events
- Pull Request
- Issues
In the Post Installation section, you need to add the Setup URL and check the option 'Redirect on update':
The setup URL: This is the base URL of your Flagsmith dashboard, followed by login?github-redirect=true
.
E.g. https://flagsmith.example.com/login?github-redirect=true
In the Webhook section, you need to check the 'active' option and add the webhook URL:
The webhook URL: This is the base URL of your Flagsmith API, followed by github-webhook/
.
E.g. https://flagsmith-api.example.com/api/v1/github-webhook/
Configuring Flagsmith
You must set the API Env variables and the Frontend Env variables to use your own GitHub App.
In the 'Webhook' section:
Webhook secret: Generate a random string of text with high entropy and put it in the field
Adding a Flagsmith Flag to a GitHub issue or pull request
- Create or select a Feature Flag.
- Go to the 'Link' Tab inside the Feature modal.
- Select your GitHub integration.
- Select GitHub Issue or GitHub PR and Save.
Removing the GitHub Integration
- From Flagsmith, click 'Integrations', find the GitHub integration and click on 'Manage Integration'.
- Click on 'Delete Integration' button, and confirm.