Downloads the content of a script hosted in GitHub and runs it as a bash script. It is very similar to Remote Bash Script Runner Step but it allows you to do a couple of things more:
- You can use it with private repos
- You can pass command line arguments
Note: after implementing it, I've found it already exists a GitHub Script Runner...but it doesn't allow to pass command line arguments, so this work is not completely wasted :_D
Can be run directly with the bitrise CLI,
just git clone
this repository, cd
into it's folder in your Terminal/Command Line
and call bitrise run cli-test
.
Add GITHUB_TOKEN
to your .bitrise.secrets.yml
file!
Step by step:
- Open up your Terminal / Command Line
git clone
the repositorycd
into the directory of the step (the one you justgit clone
d)- Create a
.bitrise.secrets.yml
file in the same directory ofbitrise.yml
(the.bitrise.secrets.yml
is a git ignored file, you can store your secrets in it) - Add your GitHub personal access token to
.bitrise.secrets.yml
(useGITHUB_TOKEN
as the key) - Run this step with the bitrise CLI:
bitrise run cli-test
An example .bitrise.secrets.yml
file:
envs:
- GITHUB_TOKEN: {your_personal_access_token}
If you want to use your step in your project's bitrise.yml
, reference it in your bitrise.yml
with the git::https://github.com/deliveroo/bitrise-step-github-script-runner.git
step reference style:
- git::https://github.com/deliveroo/bitrise-step-github-script-runner.git:
title: The title of your step
description: A description of your step (optional)
inputs:
- repository: {owner/repo} (e.g. deliveroo/mobile-scripts)
- script_path: {path_relative_to_repo_root} (e.g. promon/promon-upload-file.sh)
- branch: {default=master}
- command_line_arguments: {the same arguments you'd pass to a local script} (e.g. --local-file-path "$BITRISE_SOURCE_DIR/README.md" --remote-folder-path "deliveroo/Upload/rider")
- tmp_folder: {where you want to put all temporary files created by the script or leave it empty if you want to use the default "$BITRISE_SOURCE_DIR/tmp"}
- github_token: {your personal access token or leave it empty if you have a GITHUB_TOKEN secret configured}
That's all ;)