I’m trying to create my first Github action and likely missing something….
When I push my repo to Github and after click "Actions" in the Repo on Github it says Failure and it seems related to .github/workflows/test.yml.
Error message:
Error: .github#L1
every step must define a uses
or run
key
Anyone who can spot anything particular in my action related files?
The aim of my action is basically to run "npx ts-node index.ts" in my project/repo every 10 minutes.
project/.github/workflows/test.yml
name: Trigger Action on a CRON Schedule
on:
schedule:
# Runs "At 11:00 on every day-of-week from Monday through Friday"
- cron: "10 * * * *"
jobs:
build:
name: Trigger Script
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js 16.x
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Run my action
run: npx ts-node index.ts
project/action.yml
name: "Hunter"
author: "Bam"
description: "Hunting ..."
runs:
using: "node16"
2
Answers
This worked:
I do not see a
run:
oruses:
in this step, which could be an issue.See this GitHub Actions workflow syntax example.
with:
is normally associated withuses:
.