{"id":30237872,"url":"https://github.com/seqeralabs/action-tower-launch","last_synced_at":"2025-08-15T02:57:41.000Z","repository":{"id":152406983,"uuid":"620283203","full_name":"seqeralabs/action-tower-launch","owner":"seqeralabs","description":"GitHub Action to launch a workflow using Seqera Platform","archived":false,"fork":false,"pushed_at":"2025-08-08T16:58:43.000Z","size":1390,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-08T17:46:57.292Z","etag":null,"topics":["automation","bioinformatics","github-actions","launch","nextflow","nextflow-tower","nf-core","pipelines","seqera","seqeralabs","tower","workflows"],"latest_commit_sha":null,"homepage":"https://seqera.io/platform","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seqeralabs.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,"zenodo":null}},"created_at":"2023-03-28T11:39:17.000Z","updated_at":"2025-06-25T15:55:59.000Z","dependencies_parsed_at":"2025-06-25T16:49:03.742Z","dependency_job_id":null,"html_url":"https://github.com/seqeralabs/action-tower-launch","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/seqeralabs/action-tower-launch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seqeralabs%2Faction-tower-launch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seqeralabs%2Faction-tower-launch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seqeralabs%2Faction-tower-launch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seqeralabs%2Faction-tower-launch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seqeralabs","download_url":"https://codeload.github.com/seqeralabs/action-tower-launch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seqeralabs%2Faction-tower-launch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270506464,"owners_count":24596701,"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","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","bioinformatics","github-actions","launch","nextflow","nextflow-tower","nf-core","pipelines","seqera","seqeralabs","tower","workflows"],"created_at":"2025-08-15T02:57:40.389Z","updated_at":"2025-08-15T02:57:40.987Z","avatar_url":"https://github.com/seqeralabs.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seqeralabs/action-tower-launch\n\n**A GitHub Action to launch a workflow using [Nextflow Tower](https://tower.nf) - \u003chttps://tower.nf\u003e.**\n\nThis action uses the [Nextflow Tower CLI](https://github.com/seqeralabs/tower-cli/).\n\nContributed with ❤️ from the [@nf-core](https://github.com/nf-core/) community.\n\n## Example usage\n\n### Minimal example\n\nThis runs the current GitHub repository pipeline on [Nextflow Tower](https://tower.nf) at the current commit hash when pushed to the `dev` branch. The workflow runs on the user's personal workspace.\n\n```yaml\non:\n  push:\n    branches: [dev]\n\njobs:\n  run-tower:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: seqeralabs/action-tower-launch@v1\n        # Use repository secrets for sensitive fields\n        with:\n          access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}\n```\n\n### Complete example\n\nThis example never runs automatically, but creates a button under the GitHub repository _Actions_ tab that can be used to manually trigger the workflow.\n\nIt runs on a specified installation of Tower, with a specific organisation workspace. It also calls an external pipeline to be run at a pinned version tag.\n\nThe `--outdir` parameter is used to save results to a separate directory in the AWS bucket and the pipeline uses two config profiles.\n\n```yaml\nname: Launch on Tower\n\n# Manually trigger the action with a button in GitHub\n# Alternatively, trigger on release / push etc.\non:\n  workflow_dispatch:\n\njobs:\n  run-tower:\n    name: Launch on Nextflow Tower\n    # Don't try to run on forked repos\n    if: github.repository == 'YOUR_USERNAME/REPO'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: seqeralabs/action-tower-launch@v1\n        # Use repository secrets for sensitive fields\n        with:\n          workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}\n          access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}\n          api_endpoint: ${{ secrets.TOWER_API_ENDPOINT }}\n          compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}\n          pipeline: YOUR_USERNAME/REPO\n          revision: v1.2.1\n          run_name: ${{ github.job }}_${{ github.run_attempt }}\n          workdir: ${{ secrets.AWS_S3_BUCKET }}/work/${{ github.sha }}\n          # Set any custom pipeline params here - JSON object as a string\n          parameters: |\n            {\n                \"outdir\": \"${{ secrets.AWS_S3_BUCKET }}/results/${{ github.sha }}\"\n            }\n          # List of pipeline config profiles to use - comma separated list as a string\n          profiles: test,aws_tower\n\n      - uses: actions/upload-artifact@v3\n        with:\n          name: ${{ needs.getdate.outputs.date }}_run_logs\n          path: |\n            tower_action_*.log\n            tower_action_*.json\n```\n\n## Inputs\n\nPlease note that a number of these inputs are sensitive and should be kept secure. We recommend saving them as appropriate using GitHub repository [encrypted secrets](https://docs.github.com/en/actions/reference/encrypted-secrets). They can then be accessed with `${{ secrets.SECRET_NAME }}` in your GitHub actions workflow.\n\nNote that if you are using secrets, these will be screened in the GitHub Actions log and appear as `***`.\n\n### `access_token`\n\n**[Required]** Nextflow Tower personal access token.\n\nVisit \u003chttps://tower.nf/tokens\u003e to generate a new access token.\n\nSee the [Nextflow Tower documentation for more details](https://help.tower.nf/getting-started/usage/#via-nextflow-run-command):\n\n![workspace ID](img/usage_create_token.png)\n![workspace ID](img/usage_name_token.png)\n![workspace ID](img/usage_token.png)\n\n### `workspace_id`\n\n**[Optional]** Nextflow Tower workspace ID.\n\nNextflow Tower organisations can have multiple _Workspaces_. Use this field to choose a specific workspace.\n\nDefault: Your personal user's workspace.\n\nYour Workspace ID can be found in the organisation's _Workspaces_ tab:\n\n![workspace ID](img/workspace_id.png)\n\nDefault: Your primary workspace.\n\n### `compute_env`\n\n**[Optional]** Nextflow Tower compute environment name _(not ID)_.\n\nDefault: Your primary compute environment.\n\n### `api_endpoint`\n\n**[Optional]** Nextflow Tower API URL endpoint.\n\nDefault: `api.cloud.seqera.io`\n\n### `pipeline`\n\n**[Optional]** Workspace pipeline name or full pipeline URL.\n\nFor example, `https://github.com/nf-core/sarek`.\nCan also be the name of a preconfigured pipeline in Nextflow Tower.\n\nDefault: The current GitHub repository (`https://github.com/${{github.repository}}`).\n\n### `revision`\n\n**[Optional]** Pipeline revision.\n\nA pipeline release tag, branch or commit hash.\n\nDefault: The revision specified in Tower or the default branch of the repo.\n\n### `workdir`\n\n**[Optional]** Nextflow work directory.\n\nThe location that temporary working files should be stored. Must be accessible in the Nextflow Tower compute environment used.\n\n### `parameters`\n\n**[Optional]** Pipeline parameters.\n\nAdditional pipeline parameters.\n\nThese should be supplied as a valid JSON object, quoted as a string in your GitHub Actions workflow. See example usage above for an example.\n\n\u003e JSON is required (not YAML) because we do some parsing and dumping to ensure that the action handles multi-line string formatting correctly.\n\n### `profiles`\n\n**[Optional]** Nextflow config profiles.\n\nPipeline config profiles to use. Should be comma separated without spaces.\n\n### `run_name`\n\n**[Optional]** Nextflow Tower run name\n\nProvide a name for the run in Nextflow Tower.\n\n### `nextflow_config`\n\n**[Optional]** Nextflow config options.\n\nUseful to pass custom Nextflow config options to the `tw launch` command e.g.\n\n```yaml\njobs:\n  run-tower:\n    steps:\n      - uses: seqeralabs/action-tower-launch@v1\n        with:\n          nextflow_config: |\n            process.errorStrategy = 'retry'\n            process.maxRetries = 3\n          # Truncated..\n```\n\n### `pre_run_script`\n\n**[Optional]** Pre-run script before launch.\n\nPre-run script executed before pipeline launch. This would be particularly useful if you wanted to use a different version of Nextflow than the default available in Tower. You can set this in the pipeline Github Actions:\n\n```yaml\njobs:\n  run-tower:\n    steps:\n      - uses: seqeralabs/action-tower-launch@v1\n        with:\n          pre_run_script: \"export NXF_VER=21.10.3\"\n          # Truncated..\n```\n\n### `wait`\n\n**[Optional]** Set GitHub action to wait for pipeline completion\n\nThe default setting is for GitHub actions to wait until a pipeline runs to completion. If you want GitHub actions to launch the workflow and then finish you can set the wait to false:\n\n```yaml\njobs:\n  run-tower:\n    steps:\n      - uses: nf-core/tower-action@v2\n        with:\n          wait: false\n          # Truncated..\n```\n\n## Outputs\n\n### Output variables\n\nThe action creates the output variable `json` which is a JSON string of metadata created by the Tower API. It looks like this and can be parsed using the built in `fromJSON()` method.\n\n```\n{\n  \"workflowId\" : \"7f061c344df044\",\n  \"workflowUrl\" : \"https://tower.nf/orgs/myorg/workspaces/myworkspace/watch/7f061c344df044\",\n  \"workspaceId\" : 123456789,\n  \"workspaceRef\" : \"[myorg / myworkspace]\"\n}\n```\n\nIn addition, each variable is available as a separate output available under the following IDs:\n\n- `workflowId`\n- `workflowUrl`\n- `workspaceId`\n- `workspaceRef`\n\nFrom the example above, we can now extend it to use the output variables in downstream steps and jobs. In this example we use the output variables twice:\n\n- We capture the output variables of the _step_ and use it as an output of the _job_. We then use it in a second job.\n- We use the outputs in a following step where we echo them to the console.\n\n```yaml\non:\n  pull_request:\n  push:\n    branches: [dev]\n\njobs:\n  run-tower:\n    runs-on: ubuntu-latest\n    # Capture action outputs as outputs for the job\n    outputs:\n      workflow_id: ${{ steps.run.outputs.workflowId }}\n      workspace_id: ${{ steps.run.outputs.workspaceId }}\n    steps:\n      - uses: seqeralabs/action-tower-launch@v1\n        with:\n          access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}\n\n      - name: Comment PR\n        uses: thollander/actions-comment-pull-request@v2\n        with:\n          message: |\n            Pipeline launched, monitor progress [here](${{ steps.runs.outputs.workflowUrl }})\n            Details:\n              - Workflow ID: ${{ steps.runs.outputs.workflowId }}\n              - Workspace: ${{ steps.runs.outputs.WorkspaceRef }}\n              - Workspace ID: ${{ steps.runs.outputs.workspaceId }}\n              - Workflow URL: ${{ steps.runs.outputs.workflowUrl }}\n          comment_tag: towerrun\n\n      # Capture JSON + logs and save as artifacts\n      - uses: actions/upload-artifact@v3\n        if: success() || failure()\n        with:\n          name: ${{ needs.getdate.outputs.date }}_run_logs\n          path: |\n            tower_action_*.log\n            tower_action_*.json\n\n  # We install the Tower CLI and use the variables to get the details of the pipeline run.\n  get_details:\n    runs-on: ubuntu-latest\n    needs: [run-tower]\n    steps:\n      - name: Get run details\n        run: |\n          # Install TW CLI\n          wget -L https://github.com/seqeralabs/tower-cli/releases/download/v0.7.3/tw-0.7.3-linux-x86_64\n          sudo mv tw-* /usr/local/bin/tw\n          chmod +x /usr/local/bin/tw\n\n          # Use variables with ${{ needs.id.outputs.variable }} syntax\n          tw -o json runs view \\\n             -w ${{ needs.run-tower.outputs.workspace_id }} \\\n             -i ${{ needs.run-tower.outputs.workflow_id }}\n```\n\n### Files\n\nThe action prints normal stdout info-level log messages to the actions console. However, it also saves a verbose log file and an output JSON of job details as a file. We recommend using [`actions/upload-artifact`](https://github.com/actions/upload-artifact) in your GitHub Actions workflow as shown in the examples above, this will then expose this file to be used in subsequent jobs and as a download through the workflow summary page.\n\nThe output log file is saved as `tower_action_$(timestamp).log` and can be captured using `actions/upload-artifact using the following settings:\n\n```yaml\n- uses: actions/upload-artifact@v4\n  with:\n    name: Tower debug log file\n    path: tower_action_*.log\n```\n\nThe action writes a JSON file which has the same format as the `outputs.json` used above. This is wrtten to a file called `tower_action_$(uuidgen).json`. It can be captured in a similar manner:\n\n```yaml\n- uses: actions/upload-artifact@v4\n  with:\n    name: Tower output JSON file\n    path: tower_action_*.json\n```\n\n## Credits\n\nThis GitHub Action was written by Phil Ewels ([@ewels](https://github.com/ewels)), with help from and based on earlier work by Gisela Gabernet ([@ggabernet](https://github.com/ggabernet)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseqeralabs%2Faction-tower-launch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseqeralabs%2Faction-tower-launch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseqeralabs%2Faction-tower-launch/lists"}