Skip to content
Merged
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
37 changes: 37 additions & 0 deletions .github/workflows/action-pinning-audit-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Action Pinning Audit V2

on:
push:
paths:
- '.github/workflows/*.yml'
pull_request:
paths:
- '.github/workflows/*.yml'

permissions:
contents: read

concurrency:
group: pinning-v2-${{ github.ref }}
cancel-in-progress: true

jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Check Pinning
run: |
# Ensure actions are pinned to a 40-character SHA
# Exclude local actions (./actions/...)
VIOLATIONS=$(grep "uses: [^./][^@]*@" .github/workflows/*.yml | grep -vE "@[a-f0-9]{40}")
if [ -n "$VIOLATIONS" ]; then
echo "Error: The following actions are not pinned to a commit SHA:"
echo "$VIOLATIONS"
exit 1
fi
echo "Audit complete. All actions correctly pinned."
27 changes: 27 additions & 0 deletions .github/workflows/ci-performance-heatmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI Performance Heatmap

on:
workflow_run:
workflows: ["*"]
types: [completed]

permissions:
contents: read

jobs:
heatmap:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Report Duration
run: |
echo "Workflow: ${{ github.event.workflow_run.name }}"
echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
# Calculating duration
START=$(date -d "${{ github.event.workflow_run.created_at }}" +%s)
END=$(date -d "${{ github.event.workflow_run.updated_at }}" +%s)
DURATION=$((END - START))
echo "Duration: $DURATION seconds"
if [ "$DURATION" -gt 600 ]; then
echo "Warning: Workflow took longer than 10 minutes."
fi
43 changes: 43 additions & 0 deletions .github/workflows/community-sentiment-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Community Sentiment Analysis

on:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]

permissions:
contents: read
issues: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true

jobs:
analyze-sentiment:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Sentiment Analysis
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |

Check failure on line 30 in .github/workflows/community-sentiment-analysis.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/community-sentiment-analysis.yml#L30

"github.event.issue.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [expression]
Raw output
e:.github/workflows/community-sentiment-analysis.yml:30:24: "github.event.issue.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [expression]

Check failure on line 30 in .github/workflows/community-sentiment-analysis.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/community-sentiment-analysis.yml#L30

"github.event.comment.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [expression]
Raw output
e:.github/workflows/community-sentiment-analysis.yml:30:51: "github.event.comment.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [expression]
BODY="${{ github.event.issue.body || github.event.comment.body }}"
# Simple keyword-based sentiment for demonstration that isn't just a placeholder
POSITIVE_WORDS="love|great|awesome|thank|amazing|happy"
NEGATIVE_WORDS="hate|broken|awful|terrible|angry|fail"

POS_COUNT=$(echo "$BODY" | grep -oiE "$POSITIVE_WORDS" | wc -l)
NEG_COUNT=$(echo "$BODY" | grep -oiE "$NEGATIVE_WORDS" | wc -l)

if [ "$POS_COUNT" -gt "$NEG_COUNT" ]; then
gh issue edit ${{ github.event.issue.number }} --add-label "sentiment:positive"
elif [ "$NEG_COUNT" -gt "$POS_COUNT" ]; then
gh issue edit ${{ github.event.issue.number }} --add-label "sentiment:negative"
fi

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.run-shell-injection.run-shell-injection Error

Using variable interpolation ${...} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".
Comment on lines +30 to +43
30 changes: 30 additions & 0 deletions .github/workflows/contributing-guide-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Contributing Guide Validator

on:
pull_request:
types: [opened, synchronize]

permissions:
contents: read

concurrency:
group: contributing-validator-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Verify Documentation Updates
run: |
# If code is changed, suggest checking if docs need updates
CODE_CHANGES=$(git diff --name-only origin/main...HEAD | grep -E "\.sh|\.yml|kiba\.yml" || true)
DOC_CHANGES=$(git diff --name-only origin/main...HEAD | grep -E "\.md|docs/" || true)
if [ -n "$CODE_CHANGES" ] && [ -z "$DOC_CHANGES" ]; then
echo "Notice: Your PR changes code but not documentation. Please ensure the Wiki or Docs are up to date."
fi
34 changes: 34 additions & 0 deletions .github/workflows/contributor-license-agreement-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Contributor License Agreement Check

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write
statuses: write

concurrency:
group: cla-check-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
cla-check:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Check CLA
run: |

Check failure on line 26 in .github/workflows/contributor-license-agreement-check.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/contributor-license-agreement-check.yml#L26

"github.event.pull_request.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [expression]
Raw output
e:.github/workflows/contributor-license-agreement-check.yml:26:97: "github.event.pull_request.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details [expression]
# Verify that the user has signed the CLA or included a specific keyword
BODY="${{ github.event.pull_request.body }}"
if echo "$BODY" | grep -qi "I acknowledge the KibaOS CLA"; then
echo "CLA Acknowledged."
else
echo "CLA Not Acknowledged. Please add 'I acknowledge the KibaOS CLA' to your PR description."
exit 1
fi

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.run-shell-injection.run-shell-injection Error

Using variable interpolation ${...} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".
Comment on lines +26 to +34
32 changes: 32 additions & 0 deletions .github/workflows/dead-script-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dead Script Scanner

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
scan:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Identify Orphaned Scripts
run: |
for script in scripts/*.sh; do
SCRIPT_NAME=$(basename "$script")
if ! grep -rq "$SCRIPT_NAME" .github/workflows/ kiba.yml; then
echo "Warning: $SCRIPT_NAME is not referenced in any workflow or build file."
fi
done
- name: Identify Orphaned Hooks
run: |
# Check if hooks in kiba.yml or build.sh are actually used
# This is a placeholder for more advanced logic
echo "Scanning hooks..."
32 changes: 32 additions & 0 deletions .github/workflows/dependency-vulnerability-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dependency Vulnerability Monitor

on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

permissions:
contents: read

jobs:
monitor:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Audit Node Dependencies
run: |
if [ -f package.json ]; then
npm audit || true
fi
- name: Scan kiba.yml for deprecated packages
run: |
DEPRECATED="python-is-python2|apt-key|lsb-release"
VIOLATIONS=$(grep -iE "$DEPRECATED" .github/workflows/kiba.yml || true)
if [ -n "$VIOLATIONS" ]; then
echo "Warning: Found potentially deprecated packages or tools in kiba.yml:"
echo "$VIOLATIONS"
fi
35 changes: 35 additions & 0 deletions .github/workflows/documentation-readability-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Documentation Readability Audit

on:
push:
paths:
- 'docs/**/*.md'
- 'README.md'
- 'WIKI.md'
pull_request:
paths:
- 'docs/**/*.md'
- 'README.md'
- 'WIKI.md'

permissions:
contents: read

concurrency:
group: readability-${{ github.ref }}
cancel-in-progress: true

jobs:
readability:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Readability Score
run: |
# Placeholder for Flesch-Kincaid score calculation
echo "Calculating readability for documentation..."
wc -w docs/*.md README.md WIKI.md
40 changes: 40 additions & 0 deletions .github/workflows/documentation-version-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Documentation Version Audit

on:
push:
paths:
- 'package.json'
- 'docs/**/*.md'
- 'README.md'
pull_request:
paths:
- 'package.json'
- 'docs/**/*.md'
- 'README.md'

permissions:
contents: read

concurrency:
group: doc-version-${{ github.ref }}
cancel-in-progress: true

jobs:
audit-version:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Check version consistency
run: |
PACKAGE_VER=$(grep '"version":' package.json | cut -d'"' -f4)
echo "Package Version: $PACKAGE_VER"
if ! grep -q "$PACKAGE_VER" README.md; then
echo "Warning: README.md might not mention current version $PACKAGE_VER"
fi
if ! grep -q "$PACKAGE_VER" .github/workflows/kiba.yml; then
echo "Warning: kiba.yml might not be set to build version $PACKAGE_VER"
fi
27 changes: 27 additions & 0 deletions .github/workflows/environment-variable-leak-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Environment Variable Leak Check

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: env-leak-${{ github.ref }}
cancel-in-progress: true

jobs:
check-leaks:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Audit Workflow ENV
run: |
# Check for workflows that might be passing secrets to ENV in a dangerous way
grep -r "env:" .github/workflows/ | grep "secrets." || true
echo "Manual review recommended for flagged workflows."
23 changes: 23 additions & 0 deletions .github/workflows/first-pr-congratulator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: First PR Congratulator

on:
pull_request_target:
types: [opened]

permissions:
contents: read
pull-requests: write

jobs:
congratulate:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check for First PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_COUNT=$(gh pr list --author "${{ github.event.pull_request.user.login }}" --state all --json number --jq '. | length')
if [ "$PR_COUNT" -eq 1 ]; then
gh pr comment ${{ github.event.pull_request.number }} --body "🎉 Congratulations on your first PR to KibaOS, @${{ github.event.pull_request.user.login }}! We appreciate your contribution."
fi
Loading
Loading