Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the workflow name in the GitHub Actions configuration file from "C++ CI" to "Run Tests" to better reflect the workflow's purpose.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| spark: | ||
| image: apache/spark:4.0.0-scala2.13-java21-r-ubuntu | ||
| ports: | ||
| - 15002:15002 | ||
| options: >- | ||
| --name spark_server | ||
| --health-cmd "nc -z localhost 15002" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| env: | ||
| SPARK_NO_DAEMONIZE: "true" | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| if: runner.os == 'Linux' | ||
| run: chmod +x install_deps.sh && ./install_deps.sh | ||
| run: | | ||
| chmod +x install_deps.sh | ||
| sudo ./install_deps.sh | ||
|
|
||
| - name: Check dependencies | ||
| run: make check-deps | ||
|
|
||
| - name: Build Spark Connect Client | ||
| - name: Build Spark Connect Client Library | ||
| run: make all | ||
|
|
||
| - name: Run tests | ||
| run: make run && make test_columns && make run_tests | ||
| - name: Build Tests | ||
| run: make build-tests | ||
|
|
||
| - name: Run Tests | ||
| run: make test No newline at end of file |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 11 months ago
In general, the problem is resolved by explicitly specifying a minimal permissions block for the workflow or for the specific job, so that GITHUB_TOKEN does not inherit potentially broad repository defaults. For this workflow, the steps only require reading the repository contents for checkout; they do not need to write to the repo or interact with issues/PRs. Therefore, we can safely set permissions: contents: read.
The single best fix, without changing existing functionality, is to add a permissions block at the workflow root (top level, alongside name and on). This will apply to all jobs in this workflow and satisfy CodeQL’s requirement. Concretely, in .github/workflows/test.yml, insert:
permissions:
contents: readbetween the name: "Build and Test" line and the on: block. No other code, steps, or jobs need to be modified, and no imports or external libraries are required, because this is purely a YAML configuration change in the workflow file.
| @@ -1,5 +1,8 @@ | ||
| name: "Build and Test" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] |
No description provided.