Function set_env

Source
pub fn set_env<K, V>(k: K, v: V)
where K: ToString, V: ToString,
Expand description

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")),
);