Skip to content
database

GitHub Action

Consul KV

v1 Latest version

Consul KV

database

Consul KV

A Github Action that sets environment variables based on Consul KV

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Consul KV

uses: alvin-huang/consul-kv-github-action@v1

Learn more about this action in alvin-huang/consul-kv-github-action

Choose a version

consul-kv-github-action

GitHub Action to lookup a key in Consul KV and set its value as an environment variable.

Inputs

url

Required The URL to the Consul HTTP Agent

key

Required The key to look up in Consul KV

Example workflow

on: [push]

jobs:
  consul_kv_job:
    runs-on: ubuntu-latest
    name: A job to test getting a value from Consul KV
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: get value from Consul KV
        id: get
        uses: alvin-huang/consul-kv-github-action@v1
        with:
          url: demo.consul.io
          key: mykey
      # Use the environment variable set by the key
      - name: prints the value of the key
        run: echo "The value from Consul is ${{ env.mykey }}"