Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Autobuild with working-directory doesn't always work

Open
#2,316 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions, shell, typescript
Domain
ci-cd

Research direction

Compare the attached working.log and not-working.log, starting with how autobuild.sh receives and uses the working-directory value. Reproduce the workflow with a solution under a monorepo subdirectory and verify that autobuild consistently selects that directory rather than github.workspace; the existing manual-build workaround provides a comparison point.

Written by the indexing model from the issue text.

Description

Hi,

I'm working in a monorepo setup and was using the following CodeQL setup to run CodeQL on a sub directory
`

- name: Initialize CodeQL
  uses: github/codeql-action/init@v3
  with:
    languages: ${{ matrix.language }}
    build-mode: ${{ matrix.build-mode }}
    config: |
      queries:
        # See https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#using-queries-in-ql-packs
        - name: Security and maintainability
          uses: security-and-quality
              
- if: matrix.language == 'csharp'
  name: Build solution
  uses: github/codeql-action/autobuild@v3
  with:
    working-directory: code/<redacted>      

- name: Perform CodeQL Analysis
  uses: github/codeql-action/analyze@v3
  with:
    category: "/language:${{matrix.language}}"`

Initially, in some runs, the autobuild step correctly picked up a .sln file from the specified working directory but since yesterday, in several runs, the option can be seen to be overriden by the autobuild script and it uses the github.workspace directory i.e., the root of the monorepo.

From the logs, I can see a difference in the environment variables and how the autobuild.sh is run

not-working.log
working.log

I'm using manual build as a workaround for now.

Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.