Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JoeKleinsorge/58a1c953207f4fd98d77fdfc8401935f to your computer and use it in GitHub Desktop.
Save JoeKleinsorge/58a1c953207f4fd98d77fdfc8401935f to your computer and use it in GitHub Desktop.
Using the Branch Name to select Environment
name: Using the Branch Name to select Environment
on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
# Run the following steps with the environment
# variables based on what branch was chosen
environment: ${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go environment
uses: actions/setup-go@v3.5.0
with:
# Use environment variable for Go version
go-version: ${{ env.GO_VERSION }}
# Use environment secret for token
token: ${{ secrets.GO_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment