/javascript-actions

Automate customized tasks unique to my workflow.

MIT LicenseMIT

Write JavaScript Actions

Write your own GitHub JavaScript Action and automate customized tasks unique to your workflow.

Step 2: Configure Your Action

Let's keep going! 🚲

Excellent!

Now that we have the custom action pre-requisites, let us create joke-action action.

⌨️ Activity 1: Configure Your Action

All of the following steps take place inside of the .github/actions/joke-action directory.

We will start with using the parameters that are required and later implement some optional parameters as our action evolves.

  1. Create a new file in: .github/actions/joke-action/action.yml

  2. Add the following contents to the .github/actions/joke-action/action.yml file:

    name: "my joke action"
    
    description: "use an external API to retrieve and display a joke"
    
    runs:
      using: "node16"
      main: "main.js"
  3. Save the action.yml file

  4. Commit the changes and push them to the main branch:

    git add action.yml
    git commit -m 'create action.yml'
    git pull
    git push
  5. Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.


Get help: Post in our discussion boardReview the GitHub status page

© 2023 GitHub • Code of ConductMIT License