Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3.8'

services:
web:
container_name: nginx
image: nginx
ports:
- "15000:80"
1 change: 1 addition & 0 deletions .github/workflows/code-inspection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: [pull_request]
jobs:
build_and_inspect:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success'}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '1,160p' .github/workflows/code-inspection.yml
printf '\n---\n'
rg -n "workflow_run|pull_request|if:" .github/workflows -g '*.yml' -g '*.yaml'

Repository: JimPans3/code-inspection

Length of output: 1314


Don't read workflow_run on pull_request

This workflow only runs on pull_request, so github.event.workflow_run.conclusion is unavailable and the job is skipped. Remove the guard, or switch this workflow to workflow_run if it needs to gate on a prior run.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/code-inspection.yml at line 6, Remove the
github.event.workflow_run.conclusion guard from the workflow job condition in
code-inspection.yml, since this workflow runs on pull_request events where
workflow_run is unavailable. Keep the existing pull-request trigger and allow
the job to execute normally.

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy app
on: [pull_request]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift

Do not deploy untrusted pull_request content with SSH secrets.

This workflow runs on PRs, checks out PR-controlled files, and uses deployment credentials to run the remote Compose stack. A same-repo PR can alter the workflow or .deploy/docker-compose.yml and get remote execution or leak secrets. Move deployment to a protected post-merge/manual workflow or deploy only a trusted artifact from a protected branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml at line 2, Replace the pull_request-triggered
deployment in the workflow with a protected post-merge or manual trigger, such
as a trusted protected-branch push or workflow_dispatch. Ensure deployment
credentials and SSH execution only use trusted workflow configuration and
artifacts, not PR-controlled workflow files or .deploy/docker-compose.yml
content.


jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
Comment on lines +8 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== workflow files ==\n'
git ls-files .github/workflows

printf '\n== deploy workflow outline ==\n'
wc -l .github/workflows/deploy.yml
cat -n .github/workflows/deploy.yml | sed -n '1,220p'

Repository: JimPans3/code-inspection

Length of output: 1224


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== git/auth related references in deploy workflow ==\n'
rg -n --no-heading -S 'persist-credentials|git\s+(push|commit|tag|fetch|pull)|github\.token|GITHUB_TOKEN|checkout@' .github/workflows/deploy.yml

printf '\n== all workflow files mentioning actions/checkout ==\n'
rg -n --no-heading -S 'actions/checkout@' .github/workflows

Repository: JimPans3/code-inspection

Length of output: 445


🌐 Web query:

actions/checkout current major release commit SHA v5

💡 Result:

As of July 16, 2026, the current major release version of actions/checkout is v7 [1][2]. The v5 release, which introduced Node.js 24 support, was released on August 11, 2025 [3][4]. While Git tags point to specific commit SHAs, it is standard practice in GitHub Actions to reference the major version tag (e.g., @v5) rather than a specific commit SHA to receive automated updates for that major version [5]. As of today, the commit SHA associated with the v5.0.0 tag is a1281861942152010c2843477811904533036412. However, for current implementations, referencing the latest major version, currently v7, is recommended [1][5].

Citations:


Harden the checkout step. Update actions/checkout to @v7 and set persist-credentials: false; this job doesn’t use Git auth after checkout.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 8-8: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 zizmor (1.26.1)

[warning] 8-10: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 8 - 10, Update the workflow’s
actions/checkout step to use `@v7` and set persist-credentials to false, while
preserving fetch-depth: 0 and the rest of the job unchanged.

Source: Linters/SAST tools

- uses: appleboy/scp-action@v0.1.4
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: ".deploy/"
target: "~/"
- uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd .deploy
/home/timo/bin/docker-compose-v2 up -d
4 changes: 4 additions & 0 deletions src/CodeInspectionApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
var i = 0;

Console.WriteLine("Hello, World!");

var x = 2;

Console.WriteLine(x);
Loading