From the course: Practical GitHub Actions
Crafting an action.yml file - GitHub Tutorial
From the course: Practical GitHub Actions
Crafting an action.yml file
- All right, we need one more file to make this generator work, and that is going to be the action file. Now, this is a little bit different from our other action file. This file will be run from basically a separate repo and do things to all of the other files that we've been creating so far. So let's go ahead and make it. We will call this one "Action dot Y M L" and in here we will write just basically what's normal action code, but it's just going to do something slightly different than a regular action. Also, it doesn't go in the workflow document like it normally would for regular actions. So this will say "Podcast Generator," I'll go ahead and promptly add my name here, I'll put in a short description, and then I'll issue a series of commands. So just like before, runs, and here we'll say it's going to run using Docker. And for an image we're going to use the Docker file that we created. Now, normally you can add a piece of branding to these things, so that in the marketplace, they have a little icon and the icons come from a library called "Feather Icons." So, we'll use an icon called "Git Branch," because it's the one that makes the most sense, honestly, in most of the instances. This isn't a a big deal, and then I'll make it red. It's just something people do for these things. All right, so inputs is going to have the email. So, remember when we were creating the entry point, we are sort of relying on some of these variables being available to us. So here for the email, we'll use a description and we will say that the default for this is going to be basically the GitHub actor, and that will let us just get the email from whoever runs the action. So "GitHub, dot actor, at local host." And then we'll get the name as well, make it required, and create a default here. So just matching what we're using in our project. We'll just space these out a little bit better so that they look nicer. And so, this is an action that basically controls what is happening with all the files in here as well. So when you use another repository to run this repository, it's going to find this action, understand that it needs to use the Docker image, run the Docker file to generate the server, then this runs the entry point. The entry point is going to set up, "Git run, feed dot py," and then push that all back onto the server. And after all that, it should generate your feeds from another repository. So in the next video, we'll go ahead and link everything together and I'll show you how to call this file from a different repository.