Closed sohalloran closed 2 years ago
Like our "hello world" action, this action will require at least one input:
parameter. We need this parameter so that our JavaScript for this action has access to the output:
from the joke action.
If you recall, in the my-workflow.yml
file, we stated this action would take a specific input named joke:
and we set it's value to the output of the previous action.
- name: create-issue
uses: ./.github/actions/issue-maker
with:
joke: ${{steps.jokes.outputs.joke-output}}
Because of this, we need to define joke:
as one of our inputs:
for this action. Remember when we did this with the first action? It looked a little like this:
inputs:
first-greeting:
description: who you would like to greet in the console
required: true
default: Hubot
Now, we will do something similar so that our action matches what our workflow expects.
💡All of the following steps take place inside of the .github/actions/issue-maker
directory.
We will use the joke output, an issue-title
, and the repo-token
in this portion of the course as inputs:
for our action.
Create a file named action.yml
with the following contents:
name: "I have issues"
description: "consume the output of the previous action and create a new issue in the repository"
inputs:
joke:
description: "This will become the body of the created issue"
issue-title:
description: "Every issue needs a title, it's nice to supply one, even though you could do this dynamically within your code"
default: "a joke for you"
required: true
repo-token:
description: "Token with permissions to do repo things"
runs:
using: "node12"
main: "index.js"
action.yml
filegit add action.yml
git commit -m 'create action.yml'
git push
I will respond when you commit to this branch.
sohalloran it's time to get ready for the third action 🎉
As with the other actions we wrote, we are going to need to setup a few directories and files.
:keyboard: Activity: Configure your third action
Let's create our final project directory and install all the necessary dependencies. We will take this a step further near the end of this action and we will show you how to avoid needing to check in
node_modules
..github/actions
directory.main
branchaction-three
branch you created for this pull request..github/actions/issue-maker
.issue-maker
folder you just created. The full path should be.github/actions/issue-maker
npm
:I will respond once you have pushed to this branch.