English 中文(简体)
How to echo an environment GitHub variable to a yml file in a workflow
原标题:

I have created a new environment in GitHub and created a new env var with Oktokit, Now I want to use this variable in a yml workflow file I read the documentation but I couldn t really understand what am I doing wrong.

The official documentation says the following this:

on:
  workflow_dispatch:
env:
  # Setting an environment variable with the value of a configuration variable
  env_var: ${{ vars.ENV_CONTEXT_VAR }}

Now, my code looks like this:

on:
  workflow_dispatch:
env:
  # Setting an environment variable with the value of a configuration variable
  last_automated_release: ${{ vars.LAST_AUTOMATED_RELEASE }}

....

  - name: Echo env var
    run: |
      echo "variable from shell environment: $last_automated_release"
      echo "variable from shell1 environment: ${{ env.last_automated_release }}"

No matter what I receive an empty string in the CI

I know the variable contains data: enter image description here

What am I doing wrong?

问题回答

暂无回答




相关问题
GitHub SAML SSO ( cloud enterprise)

I wanted to integrate GitHub saml sso for the project. I have a custom IDP and from the SP initiated saml flow, like getting to the https://github.com/orgs/ORG-NAME/sso and then sso getting successful,...

How do I clone a github project to run locally?

I am trying to follow this railscast tutorial for authlogic - and it points to the source here - I have git installed - how do I replicate the source onto my localhost so that I can follow the ...

git push heroku master permission denied on VISTA

(Using Vista)I m trying to clone an app from my GitHub Repository and push it into Heroku. Okay, so I ve tried to create an SSH key so many times with this: `ssh-keygen -t rsa` It seems to go ...

SSH Public key denied on "git clone" command

I am trying to clone a git repo that I forked in my GitHub Repository.It s a rails app. I want to clone it on my local git so that I can push it onto heroku. I generated a set of rsa keys and copied ...

heroku using git branch is confusing!

Ok, so I have a big github project that i m not supposed to merge my little Stacia branch into. However, it seems like Heroku only takes pushing MASTER seriously. It looks like I pushed my branch, but ...

热门标签