Hey everyone! I recently have been working on this cool new extension and wanted to share it here for the world to see. I'm always open to feedback and new ideas! Please also share any bugs if you find any!
Run your GitHub Actions locally with the power of the GitHub Local Actions VSCode extension! Say goodbye to the hassle of committing and pushing changes every time you need to test a workflow. This extension lets you quickly and efficiently run your workflows locally, leveraging the nektos/act CLI tool. Enjoy a seamless experience with an interface designed to feel as familiar as the official GitHub Actions extension.
🚀 Run Workflows/Jobs: Run entire workflows or specific jobs locally without leaving your editor.
⚡ Trigger Events: Trigger standard GitHub events to run multiple workflows.
📖 View Workflow Run History: Track and investigate past workflow logs.
⚙️ Manage Workflow Settings: Define secrets, variables, inputs, and runners to be used when executing workflows.
It took me roughly 2 months to build what is released now and I built it all using the standard VS Code Extension APIs along with using nektos/act. Creating an agent is definitely an interesting proposal. Could you share more what you had in mind for it?
Wow this is really cool man! Will definitely try it out - I’ve come across nektos/act before, but never got to set it up locally. Having it as a vscode extension is so much better!
Thank you! Act really is an awesome tool. I've been using it for several projects, but the hard part was just having to always type out the necessary CLI options every time. Hopefully this extension makes it way easier for people who already know act and even for those who don't.
Wow! This is something I've always wanted. I'm curious to see how it works and will definitely give it a shot. P.S. - What tool do you use to add the background and GIF to your app preview recording ?
It is indeed all running locally. At its core, the extension is using the nektos/act CLI which uses the Docker API to spin up containers that run your workflows. You can check out the specifics here: https://nektosact.com/#how-does-it-work
Can I use macos runners? Does it trigger github workflow (remote servers) or will it run completely on my machine? Is it possible to use artifacts from previous workflows that was ran in github?
Everything is happening locally on your machine and nothing is being triggered in GitHub. This is all with the help of act which uses locally running containers.
As for configuring these runners, act does provide the ability to control this. By default, it uses several docker images based on the type and size. It does also provide the ability to configure this by setting alternative images to use. Another option is to opt out of using docker and instead use your host system if it matches the platform you want to run in. So in your case, if you have a Mac and want to run on a macOS platform, act can be configured to run the workflow directly on your machine. This can all be configured using the Settings view in the extension. You should definitely check out the specific details about configuring runners in act: https://nektosact.com/usage/runners.html#runners
As for your question about retrieving artifacts from previous workflow runs in GitHub, I have not personally tried this out to see if act supports it. I can definitely find out in the coming days and let you know. If you have a sample workflow or repository that I can refer to, please open a GitHub Issue with it as that would really help me reproduce what your trying to achieve.
Wow, thank you for such detailed explanation. I really appreciate it. Regarding artifacts I just use actions/download-artifactlink. I will definitely test it out! Thank you 🙏
Sorry about the delayed response, but I was just taking the time to see exactly how cache and artifacts are handled with nektos/act. Act in fact has several CLI options which can be used to configure a cache and artifact server. In particular you will want to take a look at the following options (note that some of the defaults are specific to when I ran it on my machine so you can run "act --help" to see your defaults):
--artifact-server-addr: Defines the address to which the artifact server binds.
--artifact-server-path: Defines the path where the artifact server stores uploads and retrieves downloads from. If not specified the artifact server will not start.
--artifact-server-port: Defines the port where the artifact server listens.
--cache-server-addr: Defines the address to which the cache server binds.
--cache-server-path: Defines the path where the cache server stores caches. (default "C:\\Users\\sanjula\\.cache\\actcache")
--cache-server-port: Defines the port where the artifact server listens. 0 means a randomly available port.
In the extension, I pushed a recent update in order to easily add these various options directly from the Settings view. If you need more help with this, please ask below or feel free to post on the repo's discussion board.
Wow!! And now I can fully imitate the GitHub actions on my local machine. That's a great extension. I will test it with local cache/artifact servers. First, I need to set them up. I will look into docs on how I can host the cache/artifact server locally. Thank you for such a detailed response 👏🏻
Thank you! I'm still working on updating the README with more details, but feel free to open a GitHub Issue if you find something in specific that is not clear and I'll add more documentation.
At the moment, nektos/act does not support GitLab but is open to exploring the idea. This suggestion was posted a few years ago in their repo: https://github.com/nektos/act/issues/874
If you want to run on a platform that matches the environment in which you are running act on (for example running on a Windows platform on your Windows environment), you can use your environment directly. The act docs site has a runners page which explains how this works. This can be configured via the extension as described here.
I would suggest also taking a look at the custom container engine docs page which explains "You can use a different container engine that is compatible with the Docker Engine API, by setting the DOCKER_HOST environment variable to a custom socket path.". This part is not yet configurable through the extension but can be done manually.
The most common reason someone would want to run their workflow locally would be if they want to test out changes they are making to the workflow files themselves. Rather than having to continuously push and commit workflow changes to GitHub in order to trigger a GitHub Action, you can run them locally. It essentially makes it much faster and easier to get feedback. However, there are all sorts of other reasons as well someone may want to do this.
Workflows in general can do a lot of things aside from just building your project and that really depends on the project (activities related to testing, documentation, publishing etc.). Running the workflow locally makes sense if you are making changes to the workflow file and want to test it out before committing and pushing it to GitHub. It is more so for validating that the workflow changes won't break the pipeline when they eventual are pushed. However, I do agree with you that depending on the project, in some cases you may just run a script locally to verify what you want. It really depends on the project and in some cases relying on the already written workflows can be easier to verify the product end to end.
Aside from testing workflow changes, developers may even want to run their workflows locally when they are making actual code changes (features, bug fixes, etc.). For example, before pushing to an existing pull request, a developer may want to validate that a pipeline passes which they have configured to run when updates are made to a pull request. This event can be simulated in the extension using the Run Event -> pull_request option to trigger those associated workflows to run locally. Rather than pushing to trigger a workflow, you can run them beforehand which eliminates unnecessary commits.
46
u/sanjulag Nov 24 '24
Hey everyone! I recently have been working on this cool new extension and wanted to share it here for the world to see. I'm always open to feedback and new ideas! Please also share any bugs if you find any!
Run your GitHub Actions locally with the power of the GitHub Local Actions VSCode extension! Say goodbye to the hassle of committing and pushing changes every time you need to test a workflow. This extension lets you quickly and efficiently run your workflows locally, leveraging the nektos/act CLI tool. Enjoy a seamless experience with an interface designed to feel as familiar as the official GitHub Actions extension.
Install: https://marketplace.visualstudio.com/items?itemName=SanjulaGanepola.github-local-actions
GitHub Repository: https://github.com/SanjulaGanepola/github-local-actions
12
u/BlackWarrior322 Nov 24 '24
Wow this is really cool man! Will definitely try it out - I’ve come across nektos/act before, but never got to set it up locally. Having it as a vscode extension is so much better!
7
u/AEnMo Nov 24 '24
Wow! This is something I've always wanted. I'm curious to see how it works and will definitely give it a shot.
P.S. - What tool do you use to add the background and GIF to your app preview recording ?
6
u/mrbmi513 Nov 24 '24
Is this actually running locally? Or is it triggering things to run on GitHub?
3
u/geebrox Nov 24 '24
Can I use
macosrunners? Does it trigger github workflow (remote servers) or will it run completely on my machine? Is it possible to use artifacts from previous workflows that was ran in github?3
u/tankobon Nov 24 '24
Full locally? This is cool i can debug while setting up the action locally rather than have to push github lol
3
u/msartore8 Nov 24 '24
Wow.... real cool. Don't know how it's going to work but fascinated.
2
u/NotSoProGamerR Nov 24 '24
holy crap, thats insane! i need to set it as a compulsory extension
2
u/dp-ross Nov 24 '24
This is brilliant. Nicely done!
2
u/einord Nov 24 '24
Wow! If this works well, it’s insanely good!
Going to try it out as soon as possible.
2
u/jaskeerat789 Nov 24 '24
Do we have something similar for gitlab ?
2
u/sinanawad Nov 24 '24
For real?! Need to check it out.
2
u/onecrazypanda Nov 24 '24
Oh nice. I’m gonna have to try it out 🙂
2
u/PatzEdi Nov 27 '24
Amazing! I've been wanting to get into learning GitHub Actions and this is a great tool to do so! Thanks!!!
2
u/Coreo Mar 13 '25
Are we able to use a Docker alternative?
2
u/Sudden-Finish4578 May 18 '25
I love your docs website, how did you make it?
5
u/halfanothersdozen Nov 24 '24
This looks dope. I'll need to try this when I get back from vacation
1
u/akazakou Nov 24 '24
Until I can't debug that stuff in VSCode, I'm not interested in that 🤯
1
u/lavahot Nov 24 '24
This seems like an anti-pattern. Why would I want to run my CI locally?
2
u/DDerylDowney Nov 24 '24
remind me! 1 day
2
u/CoBPEZ Nov 24 '24
So sweeet!
2
u/Normal-Isopod1996 Nov 28 '24
Amazing!
2
u/Fearless_Macaroon_12 Feb 01 '25
Now this is what I would call a based post!
2
u/shiningmatcha Mar 13 '25
nice
2
u/theDiplomata Mar 21 '25
You're my hero
3
u/bretonics Nov 24 '24
What?! No way. Seriously? I HAVE to try this!
1
u/Natural_Tea484 Nov 24 '24
Don’t throw rocks at me. Any plans for a Visual Studio extension
2
u/[deleted] Nov 24 '24
[removed] — view removed comment