[GH-ISSUE #140] ReferenceError: 'commit' is not defined #92

Closed
opened 2026-03-01 21:40:01 +03:00 by kerem · 2 comments
Owner

Originally created by @muuvmuuv on GitHub (Mar 7, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/140

I'm currently trying to test all of my actions locally but got stuck on a few which requires commit information.

act fork
# fork.yml

name: Fork created

on:
  fork:

jobs:
  notify_email:
    name: Notify by email
    runs-on: ubuntu-latest

    steps:
      - name: Send message
        uses: appleboy/telegram-action@master
        with:
          format: markdown
          to: ${{ secrets.TELEGRAM_TO }}
          token: ${{ secrets.TELEGRAM_TOKEN }}
          message: |
            The user `<user>` forked muuvmuuv/portfolio

            ${{ commit.ref }}
[Fork created/Notify by email] ⭐  Run Send message
[Fork created/Notify by email]   ☁  git clone 'https://github.com/appleboy/telegram-action' # ref=master
ERRO[0060] Unable to interpolate string 'The user `<user>` forked muuvmuuv/portfolio

${{ commit.ref }}
' - [ReferenceError: 'commit' is not defined]
[Fork created/Notify by email]   🐳  docker build -t act-appleboy-telegram-action-master:latest /Users/marvinheilemann/.cache/act/appleboy-telegram-action@master
[Fork created/Notify by email]   🐳  docker run image=act-appleboy-telegram-action-master:latest entrypoint=[] cmd=[]
| 2020/03/07 16:02:31 Not Found
[Fork created/Notify by email]   ❌  Failure - Send message
Error: exit with `FAILURE`: 1
Originally created by @muuvmuuv on GitHub (Mar 7, 2020). Original GitHub issue: https://github.com/nektos/act/issues/140 I'm currently trying to test all of my actions locally but got stuck on a few which requires commit information. ``` act fork ``` ``` # fork.yml name: Fork created on: fork: jobs: notify_email: name: Notify by email runs-on: ubuntu-latest steps: - name: Send message uses: appleboy/telegram-action@master with: format: markdown to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} message: | The user `<user>` forked muuvmuuv/portfolio ${{ commit.ref }} ``` ``` [Fork created/Notify by email] ⭐ Run Send message [Fork created/Notify by email] ☁ git clone 'https://github.com/appleboy/telegram-action' # ref=master ERRO[0060] Unable to interpolate string 'The user `<user>` forked muuvmuuv/portfolio ${{ commit.ref }} ' - [ReferenceError: 'commit' is not defined] [Fork created/Notify by email] 🐳 docker build -t act-appleboy-telegram-action-master:latest /Users/marvinheilemann/.cache/act/appleboy-telegram-action@master [Fork created/Notify by email] 🐳 docker run image=act-appleboy-telegram-action-master:latest entrypoint=[] cmd=[] | 2020/03/07 16:02:31 Not Found [Fork created/Notify by email] ❌ Failure - Send message Error: exit with `FAILURE`: 1 ```
kerem closed this issue 2026-03-01 21:40:01 +03:00
Author
Owner

@cplee commented on GitHub (Mar 7, 2020):

I don't see commit as a supported context here: https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions

Maybe try github.ref?

<!-- gh-comment-id:596109388 --> @cplee commented on GitHub (Mar 7, 2020): I don't see `commit` as a supported context here: https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions Maybe try `github.ref`?
Author
Owner

@muuvmuuv commented on GitHub (Mar 8, 2020):

Oh yes, you are right. I can't really remember where I got this commit from. Might have been a late night miss reading.

<!-- gh-comment-id:596198814 --> @muuvmuuv commented on GitHub (Mar 8, 2020): Oh yes, you are right. I can't really remember where I got this commit from. Might have been a late night miss reading.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#92
No description provided.