[GH-ISSUE #1229] Not running when you have a if for github.event.prerelease #678

Closed
opened 2026-03-01 21:45:27 +03:00 by kerem · 1 comment
Owner

Originally created by @felipebonezi on GitHub (Jun 23, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1229

Bug report info

act version:            0.2.26
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/felipebonezi/.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Docker Engine:
        Engine version:        20.10.14
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             5.10.104-linuxkit
        OS CPU:                5
        OS memory:             7851 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act -j build --container-architecture linux/amd64

Describe issue

Cannot run pull_request event jobs when you use a yml file using if: "(github.event.release || github.event.release.prerelease) == false" in the job.

Error: Error in if-expression: "if: (github.event.release || github.event.release.prerelease) == false" (Unable to dereference 'prerelease' on non-struct 'invalid')

No response

Workflow content

name: "CI"
on:
  release:
    types: [ created ]
  push:
    branches: [ main ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ main, '**' ]
  schedule:
    - cron: '45 3 * * 1'
jobs:
  lint:
    name: Verify ScalaFmt
    if: "(github.event.release || github.event.release.prerelease) == false"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Setup JDK
        uses: actions/setup-java@v3
        with:
          distribution: corretto
          java-version: '11'
          cache: 'sbt'

      - name: Set GitHub token
        run: git config --global github.token $TOKEN
        env:
          TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Check ScalaFmt
        run: sbt scalafmtSbtCheck scalafmtCheck Test/scalafmtCheck

  checkstyle:
    name: Verify Checkstyle / ScalaStyle
    if: "(github.event.release || github.event.release.prerelease) == false"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Setup JDK
        uses: actions/setup-java@v3
        with:
          distribution: corretto
          java-version: '11'
          cache: 'sbt'

      - name: Set GitHub token
        run: git config --global github.token $TOKEN
        env:
          TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Check ScalaFmt
        run: sbt checkstyle Test/checkstyle

      - name: Check ScalaStyle
        run: sbt scalastyle test:scalastyle

      - name: Upload Checkstyle (XML)
        uses: actions/upload-artifact@v3.1.0
        with:
          name: java-checkstyle-reports
          path: ${{github.workspace}}/target/checkstyle-report.xml

      - name: Upload Style Report (XML)
        uses: actions/upload-artifact@v3.1.0
        with:
          name: scalastyle-reports
          path: ${{github.workspace}}/target/scalastyle-report/

  build:
    name: Build & Analyze
    if: "(github.event.release || github.event.release.prerelease) == false"
    needs: [ lint, checkstyle ]
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        distribution: [ 'corretto' ]
        jdk: [ '11' ]
        scala: [ '2.13.8' ]
        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
        # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      # Initializes the CodeQL tools for scanning.
      - name: Initialize CodeQL
        uses: github/codeql-action/init@v2
        with:
          languages: java
          # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
          # queries: security-extended,security-and-quality

      - name: Setup JDK
        uses: actions/setup-java@v3
        with:
          distribution: ${{ matrix.distribution }}
          java-version: ${{ matrix.jdk }}
          cache: 'sbt'

      - name: Set GitHub token
        run: git config --global github.token $TOKEN
        env:
          TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Perform Build / Test
        run: sbt ++${{ matrix.scala }} compile test

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v2

  publish:
    name: Publish to GH Packages
    if: "github.event.release || github.event.release.prerelease"
    runs-on: ubuntu-latest
    needs: [ build ]

    strategy:
      fail-fast: false
      matrix:
        distribution: [ 'corretto' ]
        jdk: [ '11' ]
        scala: [ '2.13.8' ]

    steps:
      - uses: actions/checkout@v3

      - name: Setup JDK
        uses: actions/setup-java@v3
        with:
          distribution: ${{ matrix.distribution }}
          java-version: ${{ matrix.jdk }}
          cache: 'sbt'

      - name: Set GitHub token
        run: git config --global github.token $TOKEN
        env:
          TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Publish package
        run: sbt ${{ matrix.scala }} publish

Relevant log output

DEBU[0000] Loading environment from /Users/felipebonezi/IdeaProjects/playframework-core/.env 
DEBU[0000] Loading secrets from /Users/felipebonezi/IdeaProjects/playframework-core/.secrets 
DEBU[0000] Loading workflows from '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'continouos-integration.yml' in '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/continouos-integration.yml' 
DEBU[0000] Found workflow 'pr-auto-label.yml' in '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/pr-auto-label.yml' 
DEBU[0000] Reading workflow '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/continouos-integration.yml' 
DEBU[0000] Reading workflow '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/pr-auto-label.yml' 
DEBU[0000] Planning job: build                          
DEBU[0000] Loading slug from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' 
DEBU[0000] Loading revision from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' 
DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 
DEBU[0000] HEAD points to '1125503dd0d278822b23a05004607e647caa05a8' 
DEBU[0000] using github ref: refs/heads/maintenance/remove-scala-2.12 
DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 
DEBU[0000] Loading slug from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' 
DEBU[0000] Loading revision from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' 
DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 
DEBU[0000] HEAD points to '1125503dd0d278822b23a05004607e647caa05a8' 
DEBU[0000] using github ref: refs/heads/maintenance/remove-scala-2.12 
DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 
DEBU[0000] evaluating expression '(github.event.release || github.event.release.prerelease) == false' 
DEBU[0000] evaluating expression '(github.event.release || github.event.release.prerelease) == false' 
DEBU[0000] expression '(github.event.release || github.event.release.prerelease) == false' evaluated to '%!t(<nil>)' 
DEBU[0000] expression '(github.event.release || github.event.release.prerelease) == false' evaluated to '%!t(<nil>)' 
Error:   ❌  Error in if-expression: "if: (github.event.release || github.event.release.prerelease) == false" (Unable to dereference 'prerelease' on non-struct 'invalid')

Additional information

No response

Originally created by @felipebonezi on GitHub (Jun 23, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1229 ### Bug report info ```plain text act version: 0.2.26 GOOS: darwin GOARCH: arm64 NumCPU: 10 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/felipebonezi/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 Docker Engine: Engine version: 20.10.14 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: aarch64 OS kernel: 5.10.104-linuxkit OS CPU: 5 OS memory: 7851 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act -j build --container-architecture linux/amd64 ``` ### Describe issue Cannot run `pull_request` event jobs when you use a yml file using `if: "(github.event.release || github.event.release.prerelease) == false"` in the job. Error: ❌ Error in if-expression: "if: (github.event.release || github.event.release.prerelease) == false" (Unable to dereference 'prerelease' on non-struct 'invalid') ### Link to GitHub repository _No response_ ### Workflow content ```yml name: "CI" on: release: types: [ created ] push: branches: [ main ] pull_request: # The branches below must be a subset of the branches above branches: [ main, '**' ] schedule: - cron: '45 3 * * 1' jobs: lint: name: Verify ScalaFmt if: "(github.event.release || github.event.release.prerelease) == false" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup JDK uses: actions/setup-java@v3 with: distribution: corretto java-version: '11' cache: 'sbt' - name: Set GitHub token run: git config --global github.token $TOKEN env: TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check ScalaFmt run: sbt scalafmtSbtCheck scalafmtCheck Test/scalafmtCheck checkstyle: name: Verify Checkstyle / ScalaStyle if: "(github.event.release || github.event.release.prerelease) == false" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup JDK uses: actions/setup-java@v3 with: distribution: corretto java-version: '11' cache: 'sbt' - name: Set GitHub token run: git config --global github.token $TOKEN env: TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check ScalaFmt run: sbt checkstyle Test/checkstyle - name: Check ScalaStyle run: sbt scalastyle test:scalastyle - name: Upload Checkstyle (XML) uses: actions/upload-artifact@v3.1.0 with: name: java-checkstyle-reports path: ${{github.workspace}}/target/checkstyle-report.xml - name: Upload Style Report (XML) uses: actions/upload-artifact@v3.1.0 with: name: scalastyle-reports path: ${{github.workspace}}/target/scalastyle-report/ build: name: Build & Analyze if: "(github.event.release || github.event.release.prerelease) == false" needs: [ lint, checkstyle ] runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: distribution: [ 'corretto' ] jdk: [ '11' ] scala: [ '2.13.8' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - name: Checkout repository uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: java # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - name: Setup JDK uses: actions/setup-java@v3 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.jdk }} cache: 'sbt' - name: Set GitHub token run: git config --global github.token $TOKEN env: TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Perform Build / Test run: sbt ++${{ matrix.scala }} compile test - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 publish: name: Publish to GH Packages if: "github.event.release || github.event.release.prerelease" runs-on: ubuntu-latest needs: [ build ] strategy: fail-fast: false matrix: distribution: [ 'corretto' ] jdk: [ '11' ] scala: [ '2.13.8' ] steps: - uses: actions/checkout@v3 - name: Setup JDK uses: actions/setup-java@v3 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.jdk }} cache: 'sbt' - name: Set GitHub token run: git config --global github.token $TOKEN env: TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish package run: sbt ${{ matrix.scala }} publish ``` ### Relevant log output ```sh DEBU[0000] Loading environment from /Users/felipebonezi/IdeaProjects/playframework-core/.env DEBU[0000] Loading secrets from /Users/felipebonezi/IdeaProjects/playframework-core/.secrets DEBU[0000] Loading workflows from '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows' DEBU[0000] Loading workflows recursively DEBU[0000] Found workflow 'continouos-integration.yml' in '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/continouos-integration.yml' DEBU[0000] Found workflow 'pr-auto-label.yml' in '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/pr-auto-label.yml' DEBU[0000] Reading workflow '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/continouos-integration.yml' DEBU[0000] Reading workflow '/Users/felipebonezi/IdeaProjects/playframework-core/.github/workflows/pr-auto-label.yml' DEBU[0000] Planning job: build DEBU[0000] Loading slug from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' DEBU[0000] Loading revision from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 DEBU[0000] HEAD points to '1125503dd0d278822b23a05004607e647caa05a8' DEBU[0000] using github ref: refs/heads/maintenance/remove-scala-2.12 DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 DEBU[0000] Loading slug from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' DEBU[0000] Loading revision from git directory '/Users/felipebonezi/IdeaProjects/playframework-core/.git' DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 DEBU[0000] HEAD points to '1125503dd0d278822b23a05004607e647caa05a8' DEBU[0000] using github ref: refs/heads/maintenance/remove-scala-2.12 DEBU[0000] Found revision: 1125503dd0d278822b23a05004607e647caa05a8 DEBU[0000] evaluating expression '(github.event.release || github.event.release.prerelease) == false' DEBU[0000] evaluating expression '(github.event.release || github.event.release.prerelease) == false' DEBU[0000] expression '(github.event.release || github.event.release.prerelease) == false' evaluated to '%!t(<nil>)' DEBU[0000] expression '(github.event.release || github.event.release.prerelease) == false' evaluated to '%!t(<nil>)' Error: ❌ Error in if-expression: "if: (github.event.release || github.event.release.prerelease) == false" (Unable to dereference 'prerelease' on non-struct 'invalid') ``` ### Additional information _No response_
kerem 2026-03-01 21:45:27 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Jun 23, 2022):

Consider updating act, it's fixed in v0.2.27+. ( windows users should wait to update till v0.2.29, due to issues with checkout )

<!-- gh-comment-id:1164482382 --> @ChristopherHX commented on GitHub (Jun 23, 2022): Consider updating act, it's fixed in v0.2.27+. ( windows users should wait to update till v0.2.29, due to issues with checkout )
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#678
No description provided.