The workflow is not valid. .github/workflows/main.yml: Expected format {org}/{repo}[/path]@ref. Actual 'actions/checkout' Input string was not in a correct format

I built a container action in a repo:

ourorg/generic-snowsql-action

This repo contains an action.yml file. This repo is intended to be a generic container action that I can recycle in github actions workflows in other repos. E.g. I created another repo ourorg/specific-task-that-will-use-snowsql and a workflow and I would like to reference the container action from the other repo ourorg/generic-snowsql-action.

When I attempt to checkout this container action I get an error message:

Check failure on line 9 in .github/workflows/main.yml. The workflow is not valid. .github/workflows/main.yml (Line: 9, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual 'actions/checkout' Input string was not in a correct format.

Here is ourorg/specific-task-that-will-use-snowsql/.github/workflows/main.yml

on: [push]

jobs:
  ssql_job:
    runs-on: ubuntu-latest
    name: Build ssql image
    steps:
      - name: Checkout # To use this repository's private action, you must check out the repository
        uses: actions/checkout
        with:
          repository: ourorg/generic-snowsql-action
          ref: main
      - name: Build
        uses: ./ # Uses an action in the root directory 
        with:
          config: ./config # the config file for snowsql
          query: ./training-data.sql

When I push this I get the error above. Presumably there’s an error with this piece, line 9 is

    steps:
      - name: Checkout # To use this repository's private action, you must check out the repository
        uses: actions/checkout # this is line 9!

How can I correctly tell my main.yml to checkout the container action I created over at ourorg/generic-snowsql-action?

This is the key part of the error message:

Expected format {org}/{repo}[/path]@ref

actions/checkout misses the @ref part, which is mandatory. It must provide the ref in the actions/checkout repository to use, basically the version of the action. ref can be a commit SHA, tag, or branch, depending on your security and update needs.

Hi @airtower-luna thanks for the info, I like the idea of using a commit sha and I updated my line from this:

repository: ourorg/ds-ssql-gh-action

To this:

repository: ourorg/ds-ssql-gh-action@10c0fabc8ec358d5a2c7b0ab3fdce38c195ff55b

I got the exact same error message :confused:

While I’m learning this I didn’t want to use a version tag. Is the syntax incorrect here for using a commit sha?

The error message isn’t about the repository input to actions/checkout, it’s about the uses: actions/checkout line. You need to add the ref of actions/checkout that you want to use.