Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Latest commit

 

History

History
39 lines (30 loc) · 1.54 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.54 KB

GitHub release Codefresh Plugin

A quick plugin to cover specific use case: create releases in GitHub and upload files for them. The plugin also allows to do more complex actions overriding the command manually.

Basic usage

This example creates a release and uploads files to it:

github_prerelease:
        image: codefresh/cfstep-github-release
        environment:
          - GITHUB_TOKEN=${{GITHUB_TOKEN}}
          - FILES=bin/app-*
          - PRERELEASE=true

Advanced usage

If one wants to do more actions to manage releases than just to create them, it is possible to override the behaviour with custom commands:

github_prerelease:
        image: codefresh/cfstep-github-release
        commands:
          - github-release edit --user $CF_REPO_OWNER --repo $CF_REPO_NAME --tag $CF_BRANCH_TAG_NORMALIZED --name "$CF_BRANCH_TAG_NORMALIZED"
          - github-release delete --user $CF_REPO_OWNER --repo $CF_REPO_NAME --tag $CF_BRANCH_TAG_NORMALIZED
          - github-release --help

More details about the paramaters and examples see here

Environment Variables

  • GITHUB_TOKEN: token for access to GitHub
  • CF_REPO_OWNER: Codefresh provided variable containing repository owner name
  • CF_REPO_NAME: Codefresh provided variable containing repository name
  • CF_BRANCH_TAG_NORMALIZED: Codefresh provided variable containing branch/tag name
  • PRERELEASE: If true, this variable tells the plugin to create a pre-release
  • FILES: A glob expression for the list of the files to be uploaded