[GH-ISSUE #402] index out of range error #284

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

Originally created by @MVEMCJSUNPE on GitHub (Oct 28, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/402

Act gives index out of range error:
act_error

As we can see from the screenshot, the error occurs on github.com/nektos/act@1e69525fb4/pkg/runner/step_context.go (L381) . The code fails to check if NO substring matches were found. If that is the case, then matches is an empty slice, so

ra.Org = matches[1]

causes the application to crash.

How to reproduce:

git clone https://github.com/drashland/deno-drash.git

and change .github/workflows/master.yml like mentioned in this issue message parameter 'commandLine' cannot be empty for BOTH linter and tests. Yes, it's not minimal, but the stack trace is pretty large and I'm kind of lazy.

OS: Windows 10 Home 64-bit (Build 10.0, Build 19041)
*Note: act was compiled using MinGW 64, but using go downloaded for windows.

Originally created by @MVEMCJSUNPE on GitHub (Oct 28, 2020). Original GitHub issue: https://github.com/nektos/act/issues/402 Act gives index out of range error: <img width="950" alt="act_error" src="https://user-images.githubusercontent.com/10354503/97396538-49215300-18b5-11eb-87b0-719e66177152.png"> As we can see from the screenshot, the error occurs on https://github.com/nektos/act/blob/1e69525fb4ed3ef539b108d1844b2782338046e7/pkg/runner/step_context.go#L381 . The code fails to check if NO substring matches were found. If that is the case, then matches is an empty slice, so ``` ra.Org = matches[1] ``` causes the application to crash. How to reproduce: ```pwsh git clone https://github.com/drashland/deno-drash.git ``` and change .github/workflows/master.yml like mentioned in this issue message [parameter 'commandLine' cannot be empty](https://github.com/denolib/setup-deno/issues/51#issuecomment-662442252) for BOTH linter and tests. Yes, it's not minimal, but the stack trace is pretty large and I'm kind of lazy. OS: Windows 10 Home 64-bit (Build 10.0, Build 19041) *Note: act was compiled using MinGW 64, but using go downloaded for windows.
kerem 2026-03-01 21:42:03 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@tadman commented on GitHub (Nov 10, 2020):

I've also seen this. A minimal example to reproduce it:

name: Crash
on: push
jobs:
  crash:
    name: Crashing
    runs-on: ubuntu-latest
    steps:
      - name: Crashy!
        uses: crash

I found this inadvertently because of a typo:

- name: Setup Ruby
- uses: ruby/setup-ruby@v1

Where that - on the second line is hard to spot, but wrecks everything.

<!-- gh-comment-id:724478046 --> @tadman commented on GitHub (Nov 10, 2020): I've also seen this. A minimal example to reproduce it: ```yaml name: Crash on: push jobs: crash: name: Crashing runs-on: ubuntu-latest steps: - name: Crashy! uses: crash ``` I found this inadvertently because of a typo: ```yaml - name: Setup Ruby - uses: ruby/setup-ruby@v1 ``` Where that `-` on the second line is hard to spot, but wrecks everything.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 10, 2021):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:757391501 --> @github-actions[bot] commented on GitHub (Jan 10, 2021): Issue is stale and will be closed in 7 days unless there is new activity
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#284
No description provided.