Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Polishing Your Workflow

00:00 Before moving on to a more complex workflow, let’s fine-tune this workflow a bit. In this lesson, you’ll make some adjustments to the hello _world.yaml file to only trigger it manually, and work with some nicer names.

00:14 Let’s start with the name of the workflow. Just above the on property, add name: Hello World!. Here, you don’t need to use any quotes.

00:25 YAML is very forgiving with this.

00:28 And then change the push value to workflow_dispatch. That’s the technical term for only run this workflow when I explicitly tell you to run it.

00:40 So that’s one of the different triggers that you can use with GitHub workflows. In line six, you basically define the name of your job, but just like giving your workflow a nicer formatted name, you can give a job a nicer name with a name property as well.

00:56 So indented underneath, say_hello, add name: "Say Hello!". Just a moment ago, I was saying that YAML doesn’t care so much about quotes, but you can use quotes, so let’s use quotes here.

01:12 I am not super consistent with quotes in YAML files. Let’s use this as a didactical explanation to kind of show you that you can use different quotes or no quotes in YAML, and YAML is very forgiving about that.

01:27 Go ahead and commit your code,

01:31 and add a descriptive commit message.

01:44 Now, after you’ve pushed your changes, you will see the workflow name instead of the filename in your GitHub Actions tab on your remote repository. And GitHub doesn’t run your workflow automatically.

01:56 If you still want to run the workflow, you can do so by clicking the Run workflow button in the blue box that says, This workflow has a workflow_dispatch event trigger.

02:07 It takes a moment until the workflow shows on the list, and when you click the workflow name, then you can see the nice name of the job. And when you click the workflow file on the left, you can inspect which workflow file was used for this job.

02:22 And the workflow file you just finished is actually a perfect blueprint for other workflows. It contains all the important ingredients, a nice naming, a trigger, and the job with steps.

02:34 And now with the basic workflow in place, it’s time to dive a bit deeper and use some Python in the workflows.

Become a Member to join the conversation.