1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Using your first GitHub Action

    Chris BiscardiChris Biscardi
    githubGitHub

    GitHub Actions can feel daunting. Here's a walkthrough setting up your first action that runs some command line scripts on every push to master.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: To set up our first GitHub action and use it, we'll first create a new repo. After we create our first repository, we can get to the actions by clicking on the Actions tab. GitHub has provided a set of starter workflows under the Action's namespace.

    You can see that this workflow in particular echoes "Hello, World!" and then echoes two more lines. It also uses the Action's checkout action, which comes from the same Action's namespace. We'll choose to set up this workflow.

    We'll give our workflow a name. We can see that it's fired on every push. It runs on Ubuntu, the latest, and it has the same steps that we looked at before. We'll commit this. Now we'll go back into the Actions tab. Notice that no workflows have yet been run. After cloning the repository, we can find our workflow in .github/workflows/echo-content.yml.

    We'll create a README and add it to our repo. Now that we've pushed to our repo, we can see our action running. Note that we can see the logs in real time.