DEV Community

Cover image for My 1st GitHub Action
Carike Blignaut-Staden
Carike Blignaut-Staden

Posted on

My 1st GitHub Action

My Workflow

Since I am still very new GitHub Actions and were not sure where to start, I started at the beginning.

Getting a tutorial that will help me understand the basics and to lay the foundation for my 2.0 version.

Submission Category:

DIY Deployments

Yaml File & link to repo

# This is a basic workflow to help you get started with Actions

name: Testing my first GitHub Action

on: [push]

jobs:
  hello_world_job:
    runs-on: ubuntu-latest
    name: A job to say hello
    steps:
    - name: Hello world action step
      id: hello
      # uses: carike/hello-world-javascript-action@v1
      uses: actions/hello-world-javascript-action@v1
      with:
        who-to-greet: 'Carike and Octocat'
    # Use the output from the `hello` step
    - name: Get the output time
      run: echo "The time was ${{ steps.hello.outputs.time }}"

Enter fullscreen mode Exit fullscreen mode

You can find my repo here:

GitHub logo Carike / hello-world-javascript-action

Learning to create custom GitHub Actions using JavaScript

Hello world javascript action

This action prints "Hello World" or "Hello" + the name of a person to greet to the log.

Inputs

who-to-greet

Required The name of the person to greet. Default "World".

Outputs

time

The time we greeted you.

Example usage

uses: actions/hello-world-javascript-action@v1
with:
  who-to-greet: 'Mona the Octocat'

Additional Resources / Info

If you are just like me, new to GitHub Actions, go through the guide provided by GitHub to get you started by creating a JavaScript action.

I tested it out on my own repo referenced above if you want to see it in action!

Top comments (1)

Collapse
 
seshanpillay25 profile image
Seshan Pillay

Awesome!