Skip to content

Run common task in github action or alternative of before_script in github workflow ci #27136

Answered by BrightRan
uditgaurav asked this question in Actions
Discussion options

You must be logged in to vote

@uditgaurav,
Currently, GitHub Actions does not support the feature likes before_script in Gitlab CI.

Can we place all common commands in a job that is like before_Script or something like that?

I think this is not work. if you are using GitHub-hosted runners in to run the job in your workflow, each job in the workflow executes in a fresh instance of the virtual machine. So, the system configurations (such as environment variables) you set in a job generally are not applicable to other jobs.
And GitHub Actions also does not support the feature likes Template (such as job templates and step templates) for YAML Pipelines on Azure Pipelines .

If your projects really need the similar feat…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants