I’m working through the writing-javascript-actions tutorial. 16 commits and changes later, I’m at my wit’s end.
When I run my workflow, there is a part should take the output of an API call as input to create a github issue in my local repo.
Here is the actions tab:
0s
Run ./.github/actions/joke-action/
{
id: 'AAdFBXnGlyd',
joke: "If you walk into a forest and cut down a tree, but the tree doesn't understand why you cut it down, do you think it's stumped?",
status: 200
}
If you walk into a forest and cut down a tree, but the tree doesn't understand why you cut it down, do you think it's stumped?
------
0s
Run ./.github/actions/issue-maker
with:
repo-token: ***
joke: If you walk into a forest and cut down a tree, but the tree doesn't understand why you cut it down, do you think it's stumped?
issue-title: a joke for you
Error: Not Found
The problem is, the error isn’t clear enough for me so I’ve been troubleshooting everywhere to no avail. I’m not sure what isn’t found. The first log shows that the API call is successful and it returns the quote successfully.
The JS is able to return the joke
const getJoke = require("./joke");
const core = require("@actions/core");
async function run() {
const joke = await getJoke();
console.log(joke);
core.setOutput("joke-output", joke);
}
run();
For reference, here are the relevant yml files
name: "external API action"
description: "Gets data to display a joke from an external API"
outputs:
joke-output:
description: The resulting joke from the API
runs:
using: "node12"
main: "main.js"
name: "I have issues"
description: "consume the output of the previous action and create a new issue"
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 if I can do it dynamically with code"
default: "a joke for you"
required: true
repo-token:
description: "Token with permissions to do repo things"
runs:
using: "node12"
main: "index.js"
name: JS Actions
on:
pull_request:
types: [labeled]
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Example JS Greeting Action
- name: "hello-action"
uses: ./.github/actions/hello-world
# Example action using shell commands
- name: "Shell commands"
run: |
cat README.md
echo $PATH >> testfile.txt
cat testfile.txt
ls -a
echo Complete.
# Example action using API data and pulling from external API
- name: "ha-ha"
uses: ./.github/actions/joke-action/
id: jokes
- name: create-issue
uses: ./.github/actions/issue-maker
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
joke: ${{steps.jokes.outputs.joke-output}}
Anyone who might have a clue?