Codefresh image to export GitHub Pull Request ENV vars.
1.8K
Codefresh image to export GitHub Pull Request ENV vars.
In GitHub UI:
repo scopeIn Codefresh UI:
Create a Codefresh account with a GitHub user
Currently, it is possible to have only one git provider per account. You have to create a separate Codefresh account for each of your git providers.
Add a (GitHub) repository
Select only Pull request opened under Configuration > General Settings > Automated build > Trigger by
Under Codefresh UI Environment Variables add GITHUB_TOKEN with the token you created above
Under WORKFLOW toggle from Basic to YAML, and select Inline YAML
In the inline YAML textarea, add this example YAML and click Save
version: '1.0'
steps:
CFExport:
title: Export CF_PR_ ENV vars
image: r6by/cf-github-pr-export
CFRead:
title: Test read CF_PR_ ENV vars
image: alpine:latest
commands:
- env | grep CF_PR_
In GitHub UI:
test (file can be empty), select Create a new branch for this commit and start a pull request, and click Propose new fileCreate pull requestIn Codefresh UI:
Builds, and click View log next to the build that should have triggered from your new PR.Test read CF ENV vars step should output:
CF_PR_NUMBER=1, where 1 is the number of your new PRCF_PR_STATE=OPEN, if your PR is open. Otherwise CLOSED or MERGEDCF_PR_NUMBER matches the new PR number.CF_PR_STATE matches each state.Content type
Image
Digest
Size
3 MB
Last updated
over 8 years ago
docker pull r6by/cf-github-pr-export