[GH-ISSUE #1020] Issue: Errors with CodeQL in act #593

Closed
opened 2026-03-01 21:44:48 +03:00 by kerem · 3 comments
Owner

Originally created by @katelovescode on GitHub (Mar 1, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1020

I'm trying to run all of my workflows locally and CodeQL is failing

System information

  • Operating System: MacOS Monterey

  • Architecture:

  • Apple M1: No

  • Docker version:
    Screen Shot 2022-02-28 at 9 31 08 PM

  • Docker image used in act:
    Screen Shot 2022-02-28 at 9 31 33 PM

  • act version: 0.2.25

Expected behaviour

CodeQL passes successfully

Actual behaviour

An error is thrown

Workflow and/or repository

https://github.com/pieforproviders/pieforproviders/blob/develop/.github/workflows/codeql-analysis.yml

workflow
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
  push:
    branches: [ develop ]
  pull_request_target:
    # The branches below must be a subset of the branches above
    branches: [ develop ]
  schedule:
    - cron: '34 19 * * 0'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'javascript', 'ruby' ]
        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
        # Learn more about CodeQL language support at https://git.io/codeql-language-support

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

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        languages: ${{ matrix.language }}
        # If you wish to specify custom queries, you can do so here or in a config file.
        # By default, queries listed here will override any specified in a config file.
        # Prefix the list here with "+" to use these queries and those in the config file.
        # queries: ./path/to/local/query, your-org/your-repo/queries@main

    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
    # If this step fails, then you should remove it and run the build manually (see below)
    - name: Autobuild
      uses: github/codeql-action/autobuild@v1

    # ℹ️ Command-line programs to run using the OS shell.
    # 📚 https://git.io/JvXDl

    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
    #    and modify them (or add more) to build your code if your project
    #    uses a compiled language

    #- run: |
    #   make bootstrap
    #   make release

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

Steps to reproduce

act --defaultbranch develop

act output

Log
[CodeQL/Analyze-2            ] 🧪  Matrix: map[language:ruby]
[CodeQL/Analyze-2            ] 🚀  Start image=catthehacker/ubuntu:act-latest
[CodeQL/Analyze-1            ] 🧪  Matrix: map[language:javascript]
[CodeQL/Analyze-1            ] 🚀  Start image=catthehacker/ubuntu:act-latest
[CodeQL/Analyze-2            ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[CodeQL/Analyze-1            ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[CodeQL/Analyze-1            ]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CodeQL/Analyze-2            ]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CodeQL/Analyze-2            ]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CodeQL/Analyze-1            ]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CodeQL/Analyze-2            ]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[CodeQL/Analyze-1            ]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[CodeQL/Analyze-2            ]   🐳  docker cp src=/Users/katedonaldson/Projects/pieforproviders/. dst=/Users/katedonaldson/Projects/pieforproviders
[CodeQL/Analyze-2            ]   🐳  docker exec cmd=[mkdir -p /Users/katedonaldson/Projects/pieforproviders] user= workdir=
[CodeQL/Analyze-1            ]   🐳  docker cp src=/Users/katedonaldson/Projects/pieforproviders/. dst=/Users/katedonaldson/Projects/pieforproviders
[CodeQL/Analyze-1            ]   🐳  docker exec cmd=[mkdir -p /Users/katedonaldson/Projects/pieforproviders] user= workdir=
[CodeQL/Analyze-1            ] ⭐  Run Checkout repository
[CodeQL/Analyze-1            ]   ✅  Success - Checkout repository
[CodeQL/Analyze-2            ] ⭐  Run Checkout repository
[CodeQL/Analyze-2            ]   ✅  Success - Checkout repository
[CodeQL/Analyze-1            ] ⭐  Run Initialize CodeQL
INFO[0434]   ☁  git clone 'https://github.com/github/codeql-action' # ref=v1
[CodeQL/Analyze-2            ] ⭐  Run Initialize CodeQL
INFO[0434]   ☁  git clone 'https://github.com/github/codeql-action' # ref=v1
[CodeQL/Analyze-1            ]   🐳  docker cp src=/Users/katedonaldson/.cache/act/github-codeql-action-init@v1/ dst=/var/run/act/actions/github-codeql-action-init@v1/
[CodeQL/Analyze-1            ]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/github-codeql-action-init@v1/] user= workdir=
[CodeQL/Analyze-1            ]   🐳  docker exec cmd=[node /var/run/act/actions/github-codeql-action-init@v1/lib/init-action.js] user= workdir=
[CodeQL/Analyze-2            ]   🐳  docker cp src=/Users/katedonaldson/.cache/act/github-codeql-action-init@v1/ dst=/var/run/act/actions/github-codeql-action-init@v1/
[CodeQL/Analyze-2            ]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/github-codeql-action-init@v1/] user= workdir=
[CodeQL/Analyze-1            ]   ❗  ::error::init action failed: Error: Input required and not supplied: token
| Error: Input required and not supplied: token
|     at Object.getInput (/run/act/actions/github-codeql-action-init@v1/node_modules/@actions/core/lib/core.js:109:15)
|     at getRequiredInput (/run/act/actions/github-codeql-action-init@v1/lib/actions-util.js:44:17)
|     at run (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:77:51)
|     at runWrapper (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:155:15)
|     at Object.<anonymous> (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:162:6)
|     at Module._compile (internal/modules/cjs/loader.js:1085:14)
|     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|     at Module.load (internal/modules/cjs/loader.js:950:32)
|     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
|     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
[CodeQL/Analyze-1            ]   ❌  Failure - Initialize CodeQL
[CodeQL/Analyze-2            ]   🐳  docker exec cmd=[node /var/run/act/actions/github-codeql-action-init@v1/lib/init-action.js] user= workdir=
[CodeQL/Analyze-2            ]   ❗  ::error::init action failed: Error: Input required and not supplied: token
| Error: Input required and not supplied: token
|     at Object.getInput (/run/act/actions/github-codeql-action-init@v1/node_modules/@actions/core/lib/core.js:109:15)
|     at getRequiredInput (/run/act/actions/github-codeql-action-init@v1/lib/actions-util.js:44:17)
|     at run (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:77:51)
|     at runWrapper (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:155:15)
|     at Object.<anonymous> (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:162:6)
|     at Module._compile (internal/modules/cjs/loader.js:1085:14)
|     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|     at Module.load (internal/modules/cjs/loader.js:950:32)
|     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
|     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
[CodeQL/Analyze-2            ]   ❌  Failure - Initialize CodeQL
Error: exit with `FAILURE`: 1

Originally created by @katelovescode on GitHub (Mar 1, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1020 <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> I'm trying to run all of my workflows locally and CodeQL is failing ## System information <!-- - Operating System: < Windows | Linux | macOS | etc... > - Architecture: < x64 (64-bit) | x86 (32-bit) | arm64 (64-bit) | arm (32-bit) | etc... > - Apple M1: < yes | no > - Docker version: < output of `docker system info -f "{{.ServerVersion}}"` > - Docker image used in `act`: < can be omitted if it's included in log > - `act` version: < output of `act --version`, if you've built `act` yourself, please provide commit hash > --> - Operating System: MacOS Monterey - Architecture: - Apple M1: No - Docker version: <img width="514" alt="Screen Shot 2022-02-28 at 9 31 08 PM" src="https://user-images.githubusercontent.com/8364647/156099640-c389acc2-02f0-4eef-bfd2-9331d68094f5.png"> - Docker image used in `act`: <img width="205" alt="Screen Shot 2022-02-28 at 9 31 33 PM" src="https://user-images.githubusercontent.com/8364647/156099681-68b3384b-bd73-4266-9bf9-1034c0af7af9.png"> - `act` version: 0.2.25 ## Expected behaviour <!-- - Describe how whole process should go and finish --> CodeQL passes successfully ## Actual behaviour <!-- - Describe the issue --> An error is thrown ## Workflow and/or repository <!-- - Provide workflow with which we can reproduce the issue OR - Provide link to your GitHub repository that contains the workflow--> https://github.com/pieforproviders/pieforproviders/blob/develop/.github/workflows/codeql-analysis.yml <details> <summary>workflow</summary> ```none # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. # # ******** NOTE ******** # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # name: "CodeQL" on: push: branches: [ develop ] pull_request_target: # The branches below must be a subset of the branches above branches: [ develop ] schedule: - cron: '34 19 * * 0' jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'javascript', 'ruby' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - name: Checkout repository uses: actions/checkout@v2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v1 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language #- run: | # make bootstrap # make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 ``` </details> ## Steps to reproduce <!-- - Make sure to include full command with parameters you used to run `act`, example: 1. Clone example repo (https://github.com/cplee/github-actions-demo) 2. Enter cloned repo directory 3. Run `act -s SUPER_SECRET=im-a-value` --> ``` act --defaultbranch develop ``` ## `act` output <!-- - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below --> <details> <summary>Log</summary> ```none [CodeQL/Analyze-2 ] 🧪 Matrix: map[language:ruby] [CodeQL/Analyze-2 ] 🚀 Start image=catthehacker/ubuntu:act-latest [CodeQL/Analyze-1 ] 🧪 Matrix: map[language:javascript] [CodeQL/Analyze-1 ] 🚀 Start image=catthehacker/ubuntu:act-latest [CodeQL/Analyze-2 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [CodeQL/Analyze-1 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [CodeQL/Analyze-1 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CodeQL/Analyze-2 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CodeQL/Analyze-2 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CodeQL/Analyze-1 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CodeQL/Analyze-2 ] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [CodeQL/Analyze-1 ] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [CodeQL/Analyze-2 ] 🐳 docker cp src=/Users/katedonaldson/Projects/pieforproviders/. dst=/Users/katedonaldson/Projects/pieforproviders [CodeQL/Analyze-2 ] 🐳 docker exec cmd=[mkdir -p /Users/katedonaldson/Projects/pieforproviders] user= workdir= [CodeQL/Analyze-1 ] 🐳 docker cp src=/Users/katedonaldson/Projects/pieforproviders/. dst=/Users/katedonaldson/Projects/pieforproviders [CodeQL/Analyze-1 ] 🐳 docker exec cmd=[mkdir -p /Users/katedonaldson/Projects/pieforproviders] user= workdir= [CodeQL/Analyze-1 ] ⭐ Run Checkout repository [CodeQL/Analyze-1 ] ✅ Success - Checkout repository [CodeQL/Analyze-2 ] ⭐ Run Checkout repository [CodeQL/Analyze-2 ] ✅ Success - Checkout repository [CodeQL/Analyze-1 ] ⭐ Run Initialize CodeQL INFO[0434] ☁ git clone 'https://github.com/github/codeql-action' # ref=v1 [CodeQL/Analyze-2 ] ⭐ Run Initialize CodeQL INFO[0434] ☁ git clone 'https://github.com/github/codeql-action' # ref=v1 [CodeQL/Analyze-1 ] 🐳 docker cp src=/Users/katedonaldson/.cache/act/github-codeql-action-init@v1/ dst=/var/run/act/actions/github-codeql-action-init@v1/ [CodeQL/Analyze-1 ] 🐳 docker exec cmd=[mkdir -p /var/run/act/actions/github-codeql-action-init@v1/] user= workdir= [CodeQL/Analyze-1 ] 🐳 docker exec cmd=[node /var/run/act/actions/github-codeql-action-init@v1/lib/init-action.js] user= workdir= [CodeQL/Analyze-2 ] 🐳 docker cp src=/Users/katedonaldson/.cache/act/github-codeql-action-init@v1/ dst=/var/run/act/actions/github-codeql-action-init@v1/ [CodeQL/Analyze-2 ] 🐳 docker exec cmd=[mkdir -p /var/run/act/actions/github-codeql-action-init@v1/] user= workdir= [CodeQL/Analyze-1 ] ❗ ::error::init action failed: Error: Input required and not supplied: token | Error: Input required and not supplied: token | at Object.getInput (/run/act/actions/github-codeql-action-init@v1/node_modules/@actions/core/lib/core.js:109:15) | at getRequiredInput (/run/act/actions/github-codeql-action-init@v1/lib/actions-util.js:44:17) | at run (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:77:51) | at runWrapper (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:155:15) | at Object.<anonymous> (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:162:6) | at Module._compile (internal/modules/cjs/loader.js:1085:14) | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) | at Module.load (internal/modules/cjs/loader.js:950:32) | at Function.Module._load (internal/modules/cjs/loader.js:790:12) | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) [CodeQL/Analyze-1 ] ❌ Failure - Initialize CodeQL [CodeQL/Analyze-2 ] 🐳 docker exec cmd=[node /var/run/act/actions/github-codeql-action-init@v1/lib/init-action.js] user= workdir= [CodeQL/Analyze-2 ] ❗ ::error::init action failed: Error: Input required and not supplied: token | Error: Input required and not supplied: token | at Object.getInput (/run/act/actions/github-codeql-action-init@v1/node_modules/@actions/core/lib/core.js:109:15) | at getRequiredInput (/run/act/actions/github-codeql-action-init@v1/lib/actions-util.js:44:17) | at run (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:77:51) | at runWrapper (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:155:15) | at Object.<anonymous> (/run/act/actions/github-codeql-action-init@v1/lib/init-action.js:162:6) | at Module._compile (internal/modules/cjs/loader.js:1085:14) | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) | at Module.load (internal/modules/cjs/loader.js:950:32) | at Function.Module._load (internal/modules/cjs/loader.js:790:12) | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) [CodeQL/Analyze-2 ] ❌ Failure - Initialize CodeQL Error: exit with `FAILURE`: 1 ``` </details>
kerem 2026-03-01 21:44:48 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@catthehacker commented on GitHub (Mar 1, 2022):

Missing GITHUB_TOKEN

<!-- gh-comment-id:1055151071 --> @catthehacker commented on GitHub (Mar 1, 2022): [Missing GITHUB_TOKEN](https://github.com/nektos/act#github_token)
Author
Owner

@katelovescode commented on GitHub (Mar 2, 2022):

The GITHUB TOKEN worked but I had to pass it directly to the command; the documentation stating leave blank for secure input didn't work for me.

<!-- gh-comment-id:1056104717 --> @katelovescode commented on GitHub (Mar 2, 2022): The GITHUB TOKEN worked but I had to pass it directly to the command; the documentation stating `leave blank for secure input` didn't work for me.
Author
Owner

@thediveo commented on GitHub (Nov 9, 2024):

Missing GITHUB_TOKEN

correct link to the online documentation now is: https://nektosact.com/usage/index.html?highlight=TOKEN#github_token

<!-- gh-comment-id:2466425804 --> @thediveo commented on GitHub (Nov 9, 2024): > [Missing GITHUB_TOKEN](https://github.com/nektos/act#github_token) correct link to the online documentation now is: https://nektosact.com/usage/index.html?highlight=TOKEN#github_token
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#593
No description provided.