[][src]Function actions_core::set_env

pub fn set_env<K: ToString, V: ToString>(k: K, v: V)

Creates or updates an environment variable for any actions running next in a job. Environment variables are immediately set and available to the currently running action. Environment variables are case-sensitive and you can include punctuation.

use actions_core as core;

core::set_env("MY_GREETING", "hello");

assert_eq!(
    std::env::var_os("MY_GREETING").as_deref(),
    Some(std::ffi::OsStr::new("hello")),
);