I want to create a github action to create an integration test environment. We already have a dockerized script which can do this, however, the environment is made up of 2+ repositories. So, in order to make this effective during development, we'd need to specify the branches of the other repos.
For example, let's say I have a PR in repo: frontend, branch: my-feature-brach. It requires repo: backend, branch: their-feature-branch. I'd like to kick off a build from my PR where it uses the branch of that PR (in the frontend repo), and ask me which branch to use for the backend repo.
Is this possible?
You can now specify input types for manually triggered workflows allowing you to provide a better experience to users of your workflow. In addition to the default string type, we now support choice , boolean , and environment .
To set a custom environment variable, you must define it in the workflow file. The scope of a custom environment variable is limited to the element in which it is defined. You can define environment variables that are scoped for: The entire workflow, by using env at the top level of the workflow file.
Github Actions only triggers on default branch.
To run jobs sequentially, you can define dependencies on other jobs using the jobs. <job_id>. needs keyword. Each job runs in a runner environment specified by runs-on .
You can define manually executable workflows, with inputs.
on:
workflow_dispatch:
inputs:
environment:
description: 'Define env name'
required: true
default: 'prod'
branch:
description: 'Define branch name'
required: true
default: 'master'
Than you can use these predefined parameters like:
jobs:
printInputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Env: ${{ github.event.inputs.environment }}"
echo "Branch: ${{ github.event.inputs.branch }}"
I think you can support your use case with that. More details here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With