fenya123 / forum123

Flask application written for educational purposes.
http://193.124.115.171/
1 stars 1 forks source link

46: Fix vars context in workflows #148

Closed birthdaysgift closed 1 year ago

birthdaysgift commented 1 year ago

It was definitely a mistake to use vars context in our GitHub Actions workflows. Now all values we're trying to get from vars are evaluated to empty strings (which of course is unexpected behavior) and everything works just by accident.

Actually vars context should be used to get variables which were set at the organization, repository, and environment levels. And everywhere we're using it, we don't really want to get these values from org, repo or environment. Now we don't have any org/repo/env variables, that's why all variables from vars are evaluated to empty string for us.


UPD

For develop branch at 93c4a6a:

I doublechecked this behaviour and it works - {{ vars.GITHUB_REF_NAME }} points to the current branch and {{ vars.GITHUB_REPOSITORY }} points to this repository correctly.

But there is no concrete words in GitHub Actions docs that vars context always will contain this variables. And vscode extension for GitHub Actions shows these warnings:

image

So we decided to use correct context github instead of vars to always be sure that it will work fine.