DEV Community

Discussion on: Manual trigger with Github Actions

Collapse
sabderemane profile image
Sarah Abd Author • Edited on

Thanks, my article hasn't vocation to deliver the best method and as I said, it's really hacky, but good to know and also there are other options.

I haven’t an example right now but you can easily do a step with the logic of checking if the user is part of a list of the users in the language you prefer.
Execute the file and save the result as variable and return a boolean if it's true or false. And the following steps will be conditioned according to the result.

Maybe this example can helps you :

name: Extract branch name
      id: extract_github
      run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"

In this case, in your workflow, you will be able to reuse the name of the branch if you want to do a step only on this branch :

if: steps.extract_github.outputs.branch == ’staging'