{"id":13908297,"url":"https://github.com/bitrise-steplib/steps-script","last_synced_at":"2025-04-10T06:43:17.170Z","repository":{"id":41957473,"uuid":"39377254","full_name":"bitrise-steplib/steps-script","owner":"bitrise-steplib","description":"A generic Script step for Bitrise","archived":false,"fork":false,"pushed_at":"2023-09-18T13:21:00.000Z","size":41,"stargazers_count":7,"open_issues_count":2,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T07:49:48.801Z","etag":null,"topics":["bitrise","bitrise-step","ci","hacktoberfest","production-code"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitrise-steplib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-20T10:17:43.000Z","updated_at":"2023-11-07T12:40:10.000Z","dependencies_parsed_at":"2024-11-14T03:25:46.860Z","dependency_job_id":"0012affa-7241-400e-9c54-d5fa3f161b64","html_url":"https://github.com/bitrise-steplib/steps-script","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitrise-steplib%2Fsteps-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitrise-steplib","download_url":"https://codeload.github.com/bitrise-steplib/steps-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173434,"owners_count":21059595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitrise","bitrise-step","ci","hacktoberfest","production-code"],"created_at":"2024-08-06T23:02:37.496Z","updated_at":"2025-04-10T06:43:17.153Z","avatar_url":"https://github.com/bitrise-steplib.png","language":"Shell","readme":"# Script\n\n[![Step changelog](https://shields.io/github/v/release/bitrise-io/steps-script?include_prereleases\u0026label=changelog\u0026color=blueviolet)](https://github.com/bitrise-io/steps-script/releases)\n\nRun any custom script you want. The power is in your hands. Use it wisely!\n\n\u003cdetails\u003e\n\u003csummary\u003eDescription\u003c/summary\u003e\n\n\nRun any custom script you want as part of your Bitrise build. All you need to do is specifying the script runner  \n(the default is bash), add the script, and run a build. \n\nYou can also read the script from a file.\n\n### Configuring the Step\n\n1. Set the **Execute with/runner binary** input.\n\n   Either define the path of the executor, or simply just add its name if you know it is available in the PATH, such as `ruby` or `python`. It can even be a command, such as `go run`.  \n\n1. Write your script in the **Script content** input or specify a script file.\n\n   If you have a script in your repository, you can simply run it from the file, either by calling it in the **Script content** input  \n   or, optionally, by specifying the path to it in the **Script file path** input. \n   \n   Be aware that relative paths are relative to the value set in the **Working directory** input - by default, it is your app's source directory.\n\n### Troubleshooting\n\nIf the script fails, check the executor first - obviously, a Python script will not work with a bash runner.\n\nNote that in certain cases, the filename or the filepath actually matters. For example, the `go run` command only accepts `.go` files.\n\n### Useful links\n\n* [System reports to check out the pre-installed executors](https://stacks.bitrise.io)\n* [Exporting to Test Reports from custom Script Steps](https://devcenter.bitrise.io/testing/exporting-to-test-reports-from-custom-script-steps/)\n\n### Related Steps\n\n* [Script Runner](https://www.bitrise.io/integrations/steps/script-runner)\n* [Remote Bash Script Runner](https://www.bitrise.io/integrations/steps/remote-script-runner)\n\u003c/details\u003e\n\n## 🧩 Get started\n\nAdd this step directly to your workflow in the [Bitrise Workflow Editor](https://devcenter.bitrise.io/steps-and-workflows/steps-and-workflows-index/).\n\nYou can also run this step directly with [Bitrise CLI](https://github.com/bitrise-io/bitrise).\n\n## ⚙️ Configuration\n\n\u003cdetails\u003e\n\u003csummary\u003eInputs\u003c/summary\u003e\n\n| Key | Description | Flags | Default |\n| --- | --- | --- | --- |\n| `content` | Type your script here.  **Make sure that it returns a non zero exit code in case of an error!** The step will only fail if your script returns with a non zero exit code!  | required | `#!/usr/bin/env bash # fail if any commands fails set -e # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully set -o pipefail # debug log set -x  # write your script here echo \"Hello World!\"  # or run a script from your repository, like: # bash ./path/to/script.sh # not just bash, e.g.: # ruby ./path/to/script.rb` |\n| `runner_bin` | The executor to be used for running the script. If it's available in the PATH you can just specify `ruby` or `python`, generally if you know the path of the executor you should define that, like `/bin/bash`.  You can even specify an execution command like `go run` instead of just a binary.  | required | `/bin/bash` |\n| `working_dir` | This directory will be set as the current working directory for the script.  Any relative path in the Script (content) will be relative to this directory.  |  | `$BITRISE_SOURCE_DIR` |\n| `script_file_path` | Save the specified script content to this path before execution. The file will be removed after the script finishes.  Generally you don't have to define this but there might be cases where the file's name or path actually matters. For example `go run` only accepts `.go` files.  If you specify a relative path then it will be relative to the *working directory* (which you can optionally specify as well).  |  |  |\n| `is_debug` | If debug=yes the step will print debug infos about the working dir, tmp file path, exit code, etc.  |  | `no` |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOutputs\u003c/summary\u003e\nThere are no outputs defined in this step\n\u003c/details\u003e\n\n## 🙋 Contributing\n\nWe welcome [pull requests](https://github.com/bitrise-io/steps-script/pulls) and [issues](https://github.com/bitrise-io/steps-script/issues) against this repository.\n\nFor pull requests, work on your changes in a forked repository and use the Bitrise CLI to [run step tests locally](https://devcenter.bitrise.io/bitrise-cli/run-your-first-build/).\n\nLearn more about developing steps:\n\n- [Create your own step](https://devcenter.bitrise.io/contributors/create-your-own-step/)\n- [Testing your Step](https://devcenter.bitrise.io/contributors/testing-and-versioning-your-steps/)\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitrise-steplib%2Fsteps-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitrise-steplib%2Fsteps-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitrise-steplib%2Fsteps-script/lists"}