GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add generate-query-help workflow · optionalg/codeql@8504724

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • generate-query-help-docs.yml
  • docs/language
    • query-help-markdown.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/generate-query-help-docs.yml‎

Copy file name to clipboard
+53Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Generate CodeQL documentation using Sphinx
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'rc/**'
8+
- 'lgtm.com'
9+
pull_request:
10+
paths:
11+
- 'docs/language/query-help/**'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Clone github/codeql
18+
uses: actions/checkout@v2
19+
with:
20+
path: codeql
21+
- name: Clone github/codeql-go
22+
uses: actions/checkout@v2
23+
with:
24+
repository: 'github/codeql-go'
25+
path: codeql-go
26+
- name: Set up Python 3.8
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: 3.8
30+
- name: Download CodeQL CLI
31+
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
32+
with:
33+
repo: "github/codeql-cli-binaries"
34+
version: "latest"
35+
file: "codeql-linux64.zip"
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Unzip CodeQL CLI
38+
run: unzip -d codeql-cli codeql-linux64.zip
39+
- name: Query help to markdown
40+
run: |
41+
PATH="$PATH:codeql-cli/codeql" python codeql/docs/language/query-help-markdown.py
42+
- name: Run Sphinx for query help
43+
uses: ammaraskar/sphinx-action@master
44+
with:
45+
docs-folder: "codeql/docs/language/query-help/"
46+
pre-build-command: "python -m pip install --upgrade recommonmark"
47+
build-command: "sphinx-build -b html . query-help-build"
48+
- name: Upload HTML artifacts
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: query-help-html
52+
path: query-help
53+
Collapse file

‎docs/language/query-help-markdown.py‎

Copy file name to clipboardExpand all lines: docs/language/query-help-markdown.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77

88
# Define which languages and query packs to consider
9-
languages = ["cpp", "csharp", "go", "java", "javascript", "python"]
9+
languages = ["go"]
1010

1111
# Running generate query-help with "security-and-quality.qls" generates errors, so just use these two suites for now
1212
packs = ["code-scanning", "security-extended"]
@@ -96,7 +96,7 @@ def subprocess_run(cmd):
9696
#
9797
# (and assumes the codeql-go repo is in a similar location)
9898

99-
# codeql_search_path = "./ql" or "./codeql-go" # will be extended further down
99+
codeql_search_path = "./codeql:./codeql-go" # will be extended further down
100100

101101
# Extend CodeQL search path by detecting root of the current Git repo (if any). This means that you
102102
# can run this script from any location within the CodeQL git repository.
@@ -105,7 +105,7 @@ def subprocess_run(cmd):
105105

106106
# Current working directory is in a Git repo. Add it to the search path, just in case it's the CodeQL repo
107107
#git_toplevel_dir = git_toplevel_dir.stdout.strip()
108-
#codeql_search_path += ":" + git_toplevel_dir + ":" + git_toplevel_dir + "/../codeql-go"
108+
codeql_search_path += ":" + git_toplevel_dir + ":" + git_toplevel_dir + "/../codeql-go"
109109
codeql_search_path = git_toplevel_dir = git_toplevel_dir.stdout.strip()
110110
except:
111111
# git rev-parse --show-toplevel exited with non-zero exit code. We're not in a Git repo

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.