HomeVideos

Automate recurring developer tasks with the GitHub Copilot app | Tutorial for beginners

Now Playing

Automate recurring developer tasks with the GitHub Copilot app | Tutorial for beginners

Transcript

93 segments

0:00

If a PR is never merged, that code

0:03

never finds its way to the codebase.

0:05

And if that PR contains security updates, well,

0:08

now we’ve got tech debt.

0:09

Managing library updates can be tedious at times.

0:13

The exact type of tedium

0:15

an automated task can handle.

0:17

Let’s see how we can use automations

0:19

in the Copilot app, to offload that tedium.

0:26

An automation is a task you set up once,

0:29

so Copilot can run it again and again.

0:32

You describe the task one time

0:34

and it keeps working without you.

0:36

So instead of opening, reading,

0:37

and triaging these types of PRs manually,

0:40

every single day, let’s describe that to chore one

0:43

time and let Copilot take it off our plate.

0:46

Creating an automation starts with two things:

0:50

a name and a trigger.

0:52

For my name, I’m going to call this

0:53

“Daily Dependabot triage”.

0:56

And then for the trigger, I can have this as ‘Manual’,

1:00

which is great if I want to kick this off myself,

1:02

maybe while I’m testing an idea.

1:04

‘Hourly’, ‘Daily’, and ‘Weekly’,

1:06

to run this on a regular schedule,

1:08

and then ‘Issue created’, which will automatically run

1:11

when an issue is created,

1:14

rather than watching the clock.

1:16

You’ll notice that I’m going to leave

1:17

this set to be 9 a.m.,

1:18

just before I typically start work.

1:21

I can choose to run this in the cloud if I want,

1:23

or let it run on my local system.

1:26

And then I’ve got my prompt,

1:27

where I can describe in natural language,

1:29

just like I was creating a session,

1:31

what it is that I want this automation to do:

1:34

“Review the open Dependabot PRs.

1:37

Group them by risk,

1:39

call out the ones that are safe to merge

1:44

and are minor bumps

1:47

as opposed to the bigger version updates.

1:51

Ensure each one’s CI

1:54

is passing, and give me a short summary

1:59

of the best next steps.”

2:03

I’m going to select the project here,

2:06

to point this at my Tailspin Toys,

2:08

which is where I have all of those Dependabot PRs,

2:12

that I’m currently managing.

2:14

And then down below I can hit ‘Create’.

2:17

Now, I don’t want to wait until 9 a.m.

2:19

for this to actually run,

2:21

so I’ll choose, ‘Create and run’,

2:24

which will kick off this job right now,

2:26

so that way I can see it in action.

2:29

Copilot will go off,

2:30

read through all of those open Dependabot PRs

2:33

and come back with exactly what I asked for:

2:36

the safe patch and minor bumps grouped together,

2:39

and the riskier versions flagged

2:41

for a closer look later on.

2:43

A chore that used to scatter my whole morning,

2:46

is now a single organized summary.

2:48

In my case, it looks like we need to update

2:50

to a newer version of Astro, something that’s beyond

2:54

just bumping the version number.

2:56

Fortunately, I can take the results of this automation,

2:59

and start a new session

3:01

right here inside of Copilot app.

3:04

So let’s ask Copilot, “Let’s update to Astro 6!”

3:12

and again, just like before,

3:14

off it goes using the context that it has right here.

3:18

Every automation run

3:20

shows up right here inside of ‘Automation’,

3:24

so that way I can always see what ran, when it ran,

3:27

and exactly what it did.

3:29

And if something

3:30

doesn’t look quite right,

3:32

it’s right there for me to review,

3:34

so my automations never feel like a black box,

3:38

working behind my back.

3:40

With automations, I can take a recurring chore,

3:42

describe it once, pick a trigger,

3:44

and let Copilot handle it.

3:46

My advice is to start exactly like we did here.

3:49

Pick a boring task,

3:50

the kind of things that you already

3:52

kind of do on autopilot, and hand it to the app.

3:56

And then, spend that attention

3:58

on what actually needs your judgment.

4:01

You can learn more in the rest

4:03

of this series and at gh.io/app

Interactive Summary

The video demonstrates how to use Copilot app automations to streamline tedious, repetitive tasks like managing Dependabot pull requests. By defining a task once with a trigger, such as a schedule, users can offload manual triaging to Copilot, which organizes PRs by risk, checks CI status, and provides summaries, allowing developers to focus on higher-level judgment tasks.

Suggested questions

3 ready-made prompts