Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to interpolate stringcontains(github.event.commits[0].message TypeError: Cannot access member '0' of undefined #736

Closed
patsevanton opened this issue Jun 15, 2021 · 4 comments
Assignees
Labels
area/workflow Relating to workflow definitions kind/bug Something isn't working

Comments

@patsevanton
Copy link

Hello! Thans for act

System information

  • Operating System: Linux
  • Architecture: x64 (64-bit)
  • Apple M1: no
  • Docker version: 20.10.6
  • Docker image used in act:
  • act version: 0.2.23
git clone https://github.com/Drill4J/admin
cd admin

Run act

act -v
DEBU[0000] Loading environment from /home/apatsev/github/admin/.env
DEBU[0000] Loading secrets from /home/apatsev/github/admin/.secrets
DEBU[0000] Loading workflows from '/home/apatsev/github/admin/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'check.yml' in '/home/apatsev/github/admin/.github/workflows/check.yml'
DEBU[0000] Found workflow 'publish.yml' in '/home/apatsev/github/admin/.github/workflows/publish.yml'
DEBU[0000] Found workflow 'release.yml' in '/home/apatsev/github/admin/.github/workflows/release.yml'
DEBU[0000] Reading workflow '/home/apatsev/github/admin/.github/workflows/check.yml'
DEBU[0000] Correcting if statements '/home/apatsev/github/admin/.github/workflows/check.yml'
DEBU[0000] Reading workflow '/home/apatsev/github/admin/.github/workflows/publish.yml'
DEBU[0000] Correcting if statements '/home/apatsev/github/admin/.github/workflows/publish.yml'
DEBU[0000] Reading workflow '/home/apatsev/github/admin/.github/workflows/release.yml'
DEBU[0000] Correcting if statements '/home/apatsev/github/admin/.github/workflows/release.yml'
DEBU[0000] Planning event: push
? Please choose the default image you want to use with act:

  - Large size image: +20GB Docker image, includes almost all tools used on GitHub Actions (IMPORTANT: currently only ubuntu-18.04 platform is available)
  - Medium size image: ~500MB, includes only necessary tools to bootstrap actions and aims to be compatible with all actions
  - Micro size image: <200MB, contains only NodeJS required to bootstrap actions, doesn't work with all actions

Default image and other options can be changed manually in ~/.actrc (please refer to https://github.com/nektos/act#configuration for additional information about file structure) Medium
DEBU[0001] Loading slug from git directory '/home/apatsev/github/admin/.git'
DEBU[0001] Found revision: 865a4e02af5018b0ab8c65bb872a1a7b6e09687a
DEBU[0001] Loading revision from git directory '/home/apatsev/github/admin/.git'
DEBU[0001] Found revision: 865a4e02af5018b0ab8c65bb872a1a7b6e09687a
DEBU[0001] HEAD points to '865a4e02af5018b0ab8c65bb872a1a7b6e09687a'
DEBU[0001] using github ref: refs/heads/bugfix/EPMDJ-7718
DEBU[0001] context env => map[ACT:true]
DEBU[0001] Evaluating '!contains(github['event']['commits'][0]['message'], '[skip ci]')' instead of '!contains(github.event.commits[0].message, '[skip ci]')'
ERRO[0001] Unable to interpolate string '${{!contains(github.event.commits[0].message, '[skip ci]')}}' - [TypeError: Cannot access member '0' of undefined]
DEBU[0001] expression '${{!contains(github.event.commits[0].message, '[skip ci]')}}' evaluated to 'false'
[Release/release] Skipping job 'release' due to '${{!contains(github.event.commits[0].message, '[skip ci]')}}'

How fixed?

@patsevanton patsevanton added the kind/bug Something isn't working label Jun 15, 2021
@catthehacker catthehacker linked a pull request Jun 15, 2021 that will close this issue
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale label Jul 16, 2021
@catthehacker catthehacker reopened this Aug 17, 2021
@catthehacker catthehacker added area/workflow Relating to workflow definitions stale-exempt Exempt from stale and removed stale labels Aug 17, 2021
@catthehacker catthehacker self-assigned this Aug 17, 2021
@aoberest

This comment has been minimized.

@ZauberNerd
Copy link
Contributor

This gets a little bit better with #908 but since it accesses github.event it still needs an event.json payload, because otherwise github.event.commits is not an array.

@catthehacker
Copy link
Member

I think this scenario is better to specifically require event file

@catthehacker catthehacker removed the stale-exempt Exempt from stale label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/workflow Relating to workflow definitions kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants