The GitHub Integration is used to connect the JFrog Pipelines platform to GitHub.
Note
JFrog and Github have announced a strategic partnership to unify code and binary management:
Read about JFrog's partnership with GitHub to Unify Code and Binaries for DevSecOps
See How to Connect the JFrog Platform to Your GitHub Environment as part of this partnership
Creating a GitHub Integration for Pipelines
You can add this integration by following steps on the Managing Pipelines Integrations page.
Here is the information you need to create this integration:
Name -- Choose a friendly name for the integration
url -- Your GitHub API endpoint. This is already hard-coded to https://api.github.com
Token -- Your GitHub personal access token with the permissions needed to run your jobs
Token permissions
To use this integration as a pipeline source, your token must be granted these permissions at minimum:
repo (all)
admin:repo_hook (read, write)
admin:public_key (read, write)
Additionally, if your organization uses SAML single sign-on, you will need to authorize your token.
HTTP Header -- Optional. Use the key and value fields to provide the name and value for the custom HTTP header you would like to pass in the HTTP requests for Git clone events.
Usage
The GitHub integration can be used in the Pipelines GitRepo resource.
The GitHub integration can also be added directly to a step in the integrations
section. For more information on Pipeline steps, see Pipelines Steps.
Default Environment Variables
When you create a resource with this integration, and create a step that uses it, a set of environment variables is automatically made available.
Environment variable | Description |
---|---|
| GitHub API location |
| The Token used to connect to GitHub |
When you add this integration directly to a step, a set of environment variables is automatically made available.
Environment variable | Description |
---|---|
| GitHub API location |
| The Token used to connect to GitHub |
Examples
This example shows how to configure an NpmBuild step using default locations and default commands. It assumes that a GitHub integration named myGithub
has been created.
This example uses a values.yml file to store the pipeline definitions.
The YAML for this example is available in this repository in the JFrog GitHub account.
For more information about running this example, see Pipeline Example: Npm Build.
NpmBuild
# This config file is templatized so that it can be easily customized. Values can be provided with a values.yml file. template: true # required for local templates valuesFilePath: ./values.yml resources: - name: npm_repo_jfp_example type: GitRepo configuration: # SCM integration where the repository is located gitProvider: {{ .Values.myRepo.gitProvider }} # Repository path, including org name/repo name path: {{ .Values.myRepo.path }} branches: # Specifies which branches will trigger dependent steps include: master - name: npm_buildinfo_jfp_example type: BuildInfo configuration: sourceArtifactory: demoArt pipelines: - name: npm_pipeline_jfp_example steps: - name: npm_build_step type: NpmBuild configuration: repositoryName: npm-virtual # required, npm repository name on artifacctory sourceLocation: . # required, location of package.json file integrations: - name: demoArt # required inputResources: - name: npm_repo_jfp_example # required