HttpError: Not Found when attempting to reference private pack

Open
#2,397 6 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, typescript
Domain
ci-cd, security

Research direction

Start by reproducing the GitHub Actions workflow with the private pack reference and compare its authentication behavior with codeql package download companyname/python-queries --github-auth-stdin. Check how the init action uses the supplied token; done when the workflow can resolve the private pack without the HttpError: Not Found failure.

Written by the indexing model from the issue text.

Description

We're trying to reference a private CodeQL pack when running init. When this runs in Github actions, we get HttpError: Not Found.

name: "SAST Scans"

on:
  push:
    branches: ["master", "main"]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: ["master", "main"]
  schedule:
    - cron: "0 */12 * * *"

jobs:
  codeql-analysis:
    name: code-scanning
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      packages: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: ["python", "javascript"]
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: ${{ matrix.language }}
          packs: companyname/python-queries
          token: ${{ secrets.CUSTOM_CODEQL_SCAN_GITHUB_TOKEN }}
          debug: true

      - name: Autobuild
        uses: github/codeql-action/autobuild@v3

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3
        with:
          category: "/language:${{matrix.language}}"
  • I've verified that we can download the pack by using codeql package download companyname/python-queries --github-auth-stdin and supply the value of secrets.CUSTOM_CODEQL_SCAN_GITHUB_TOKEN.
  • I've verified that CUSTOM_CODEQL_SCAN_GITHUB_TOKEN exists as an organization secret.
  • I've verified that this repo has access to the published package in the organization settings.
  • I've verified that the codeql scan runs fine when I remove the custom package reference.

Is there anything I'm missing or is there a bug with the init script? I'm having trouble finding any documentation around referencing private packs for CodeQL Github actions.

Thank you.

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.