Skip to content

ci: add automated SEO & crawl audit workflow for landing page - #229

Open
amankv1234 wants to merge 8 commits into
AOSSIE-Org:mainfrom
amankv1234:seo-audit-workflow
Open

ci: add automated SEO & crawl audit workflow for landing page#229
amankv1234 wants to merge 8 commits into
AOSSIE-Org:mainfrom
amankv1234:seo-audit-workflow

Conversation

@amankv1234

@amankv1234 amankv1234 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Adds a GitHub Actions workflow (.github/workflows/seo-audit.yml) that automatically audits the landing page on every push and pull request, so SEO regressions are caught in CI before they reach production.


✅ Checks Included

1. 🔗 Broken Links & Images Audit

  • Uses GayanPradeep/broken-links-crawler@v1 to crawl the live site
  • Flags any pages, links, or image assets returning 4xx/5xx errors
  • No secrets or API key required

2. 🏆 Lighthouse SEO + Performance + Accessibility Audit

  • Uses treosh/lighthouse-ci-action@v11 to run a full Google Lighthouse audit
  • Audits SEO score, performance score, and accessibility score in one pass
  • Results uploaded as artifacts and viewable via a temporary public storage link in CI logs
  • No API key or secret required — switched from SeoScoreAPI/seo-audit-action (which requires a paid/free-tier key) to this free, open approach

3. 🌐 Canonical Tag Check (<link rel="canonical">)

  • Custom Python script fetches the page as Googlebot
  • Fails CI if the canonical tag is missing entirely
  • Prints the canonical URL when found

4. 📝 Single H1 Tag Check

  • Fails CI if the page contains 0 or more than 1 <h1> tag
  • Ensures correct heading hierarchy for SEO

5. 🗂️ JSON-LD Structured Data / Schema Markup Check

  • Uses extruct to parse all JSON-LD blocks on the page
  • Fails CI if no structured schema markup is found
  • Ensures Google can parse rich results from the landing page

6. ⚡ Server Status & TTFB Check

  • Verifies the page returns HTTP 200
  • Prints Time to First Byte (TTFB) for performance tracking

🔀 Triggers

Event Branch
Push main, develop
Pull Request targeting main
Manual via Actions tab → Run workflow

🧪 How to Verify

  • Open the Actions tab on this PR and confirm the "Landing Page Audit Pipeline" run completes
  • Check the run logs for each step:
    • Broken links step → should report 0 broken links/images
    • Lighthouse step → check the temporary report link in the logs for SEO/Performance/Accessibility scores
    • Canonical / H1 / JSON-LD asserts → should each print a ✅ success line, not an AssertionError
  • Can also be triggered manually anytime via Actions → Landing Page Audit Pipeline → Run workflow

Summary by CodeRabbit

  • Tests
    • Added automated SEO and website quality checks for key page links, assets, accessibility, performance, and best-practice metrics.
    • Added validation for HTTP responses, page-load timing, canonical tags, heading structure, and structured data.
    • Added Lighthouse audits with minimum quality standards for performance, accessibility, SEO, and best practices.
    • Checks run automatically for relevant code changes and can also be started manually.

@github-actions github-actions Bot added no-issue-linked PR is not linked to any issue ci-cd CI/CD pipeline changes configuration Configuration file changes github-actions GitHub Actions workflow changes size/M Medium PR (51-200 lines changed) repeat-contributor PR from an external contributor who already had PRs merged needs-review labels Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@amankv1234, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: eb4e5a79-284e-4120-b760-08b1b4251f7c

📥 Commits

Reviewing files that changed from the base of the PR and between 17826cb and 5cf7c69.

📒 Files selected for processing (1)
  • .github/workflows/seo-audit.yml

Walkthrough

The pull request adds a GitHub Actions workflow for landing-page audits. It runs link checks, Lighthouse audits, and Python validation for HTTP status, response timing, canonical URLs, heading count, and JSON-LD markup.

Changes

SEO audit automation

Layer / File(s) Summary
Workflow setup and target selection
.github/workflows/seo-audit.yml
The workflow runs on pushes, pull requests, and manual dispatch. It selects the target URL and builds and serves the landing page for pull-request audits.
Link and Lighthouse audits
.github/workflows/seo-audit.yml, .lighthouserc.json
The workflow crawls links and runs Lighthouse audits. Lighthouse CI enforces category score thresholds and stores temporary reports.
Python landing-page validation
.github/workflows/seo-audit.yml, .github/requirements-audit.txt
The workflow installs the audit dependencies and validates HTTP 200 status, response timing, a canonical link, exactly one H1, and JSON-LD data.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant AuditTools
  participant LandingPage
  GitHubActions->>AuditTools: Run link, Lighthouse, and Python audits
  AuditTools->>LandingPage: Request and inspect the landing page
  LandingPage-->>AuditTools: Return links, metrics, and HTML
  AuditTools-->>GitHubActions: Report audit results
Loading

Suggested labels: Bash Lang

Poem

A rabbit checks each link in flight,
Lighthouse measures page height.
One H1 and schema must be clear,
Canonical paths must persevere.
Hop, hop—the audit results appear!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an automated SEO and crawl audit workflow for the landing page.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🤖 Prompt for all review comments with 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.

Inline comments:
In @.github/workflows/seo-audit.yml:
- Around line 3-8: Add a workflow-level concurrency configuration near the
existing triggers in the SEO audit workflow, using github.ref as the group key
and enabling cancel-in-progress so superseded push or pull-request audits are
cancelled while the newest run continues.
- Around line 38-40: Update the “Install Advanced Audit Dependencies” step to
install from a committed constraints or requirements file containing tested
package versions for requests, beautifulsoup4, and extruct, invoking pip through
python -m pip. Remove the unpinned package installation while preserving the
workflow’s dependency setup.
- Around line 14-15: Update the actions/checkout@v4 step in the SEO audit
workflow to set persist-credentials to false, ensuring the GITHUB_TOKEN is not
retained in the repository’s Git configuration for later steps.
- Around line 10-12: Add a top-level permissions declaration in the workflow,
setting contents to read and leaving all unspecified permissions disabled. Keep
the existing seo-and-crawl-audit job configuration unchanged.
- Around line 49-50: Update the HTTP probe in the workflow’s Python request
logic to pass an explicit connect-and-read timeout tuple to requests.get, while
preserving the existing URL and Googlebot User-Agent headers.
- Around line 24-30: Update the “Run Lighthouse Audit” step to reference a
checked-in Lighthouse CI configuration through configPath, and add that
configuration with error-level score assertions for accessibility, best
practices, SEO, and performance. Use the repository’s existing workflow/config
conventions and preserve the current audited URL and artifact uploads.
- Around line 59-62: Update the canonical tag check to collect all
rel="canonical" elements, require exactly one, and validate that its href is
non-empty and normalizes to https://social-share-button.aossie.org/. Replace the
current soup.find() existence-only assertion while preserving clear failure
messages for missing, duplicate, or incorrect canonical values.
- Around line 52-55: Update the server-status test around the response.elapsed
TTFB measurement to define a clearly documented TTFB budget and assert that
response.elapsed.total_seconds() does not exceed it, while preserving the
existing HTTP status assertion and diagnostic output.
- Line 15: Update the workflow action references in seo-audit.yml, including
actions/checkout, GayanPradeep/broken-links-crawler,
treosh/lighthouse-ci-action, and actions/setup-python, to use their
corresponding full 40-character immutable commit SHAs instead of version tags;
preserve each action version’s behavior and leave future SHA updates subject to
review or automation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e00e8abe-7a3c-45c5-bd0c-6290bdfcceec

📥 Commits

Reviewing files that changed from the base of the PR and between 16291ac and e71297c.

📒 Files selected for processing (1)
  • .github/workflows/seo-audit.yml

Comment thread .github/workflows/seo-audit.yml
Comment thread .github/workflows/seo-audit.yml
Comment thread .github/workflows/seo-audit.yml Outdated
Comment thread .github/workflows/seo-audit.yml Outdated
Comment on lines +24 to +30
- name: Run Lighthouse Audit
uses: treosh/lighthouse-ci-action@v11
with:
urls: |
https://social-share-button.aossie.org/
uploadArtifacts: true
temporaryPublicStorage: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --glob '!**/.git/**' \
  'treosh/lighthouse-ci-action|lighthouserc|configPath|assertions|budgetPath' .

Repository: AOSSIE-Org/SocialShareButton

Length of output: 249


🌐 Web query:

treosh lighthouse-ci-action v11 default assertions configPath uploadArtifacts CI fail workflow

💡 Result:

To configure treosh/lighthouse-ci-action v11 (or later) to perform CI assertions and manage artifacts, you should use the configPath and uploadArtifacts inputs in your workflow [1][2][3]. When you define assertions in a lighthouserc file (referenced by configPath), the action will automatically evaluate these assertions, and the CI workflow will fail if any assertion set to "error" is not met [1][4][5]. Key configuration details: 1. configPath: Use this input to specify the path to your lighthouserc file (e.g.,./lighthouserc.json) [4][5]. This file provides full control over LHCI assertions [4]. Example lighthouserc.json: { "ci": { "assert": { "assertions": { "categories:performance": ["error", { "minScore": 0.6 }] } } } } [4] 2. uploadArtifacts: Set this to true to save the Lighthouse reports as GitHub Actions artifacts [1][4]. This is helpful for debugging or persistent storage of results [4]. Example workflow step: - name: Audit URLs uses: treosh/lighthouse-ci-action@v11 with: urls: 'https://example.com/' configPath: './lighthouserc.json' uploadArtifacts: true [4][5] Troubleshooting workflow failures: If your workflow fails unexpectedly, check if you are using includePassedAssertions: true in your lighthouserc. In some older versions of this action, the presence of passed assertions in the results could cause the action to incorrectly report a failure [6]. Additionally, ensure that your assertions are correctly categorized as "error" if you intend for them to break the build; "warn" will typically report the issue without failing the workflow [4].

Citations:


Fail CI on Lighthouse score thresholds.

This step uploads artifacts but does not provide configPath, assertions, or score thresholds, and the repo has no checked-in Lighthouse CI config. Add a checked-in Lighthouse CI configuration with error-level assertions for accessibility, best practices, SEO, and performance, then pass it with configPath so low scores fail the workflow.

🧰 Tools
🪛 zizmor (1.29.0)

[error] 25-25: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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/seo-audit.yml around lines 24 - 30, Update the “Run
Lighthouse Audit” step to reference a checked-in Lighthouse CI configuration
through configPath, and add that configuration with error-level score assertions
for accessibility, best practices, SEO, and performance. Use the repository’s
existing workflow/config conventions and preserve the current audited URL and
artifact uploads.

Comment thread .github/workflows/seo-audit.yml Outdated
Comment thread .github/workflows/seo-audit.yml Outdated
Comment thread .github/workflows/seo-audit.yml Outdated
Comment thread .github/workflows/seo-audit.yml Outdated
@github-actions github-actions Bot added documentation Changes to documentation files javascript JavaScript/TypeScript code changes labels Aug 9, 2026
@socket-security

socket-security Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​requests@​2.34.299100100100100
Addedpypi/​beautifulsoup4@​4.15.0100100100100100

View full report

@socket-security

socket-security Bot commented Aug 9, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@amankv1234

Copy link
Copy Markdown
Contributor Author

@CodeRabbit, explaine me review given by socket-security
is any security issue in this project by this repo if yes then which create the security related issue

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In @.github/workflows/seo-audit.yml:
- Around line 21-24: The SEO audit workflow currently checks production for pull
requests instead of the checked-out revision. Update the workflow steps around
the checkout and URL references on lines 30, 37, and 60 to build and serve the
checked-out landing page or consistently use its deployment-preview URL for
pull_request runs, while retaining production smoke tests only for push and
manual triggers.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e163827b-3588-4533-a049-09a6bcce19b5

📥 Commits

Reviewing files that changed from the base of the PR and between e71297c and 94696bd.

📒 Files selected for processing (3)
  • .github/requirements-audit.txt
  • .github/workflows/seo-audit.yml
  • .lighthouserc.json

Comment thread .github/workflows/seo-audit.yml
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="AOSSIE-Org/SocialShareButton"
pr="229"

echo "== Pull request reviews =="
gh api "repos/$repo/pulls/$pr/reviews" --paginate \
  --jq '.[] | {user: .user.login, state: .state, body: .body, submitted_at: .submitted_at, html_url: .html_url}'

echo
echo "== Pull request review comments =="
gh api "repos/$repo/pulls/$pr/comments" --paginate \
  --jq '.[] | {user: .user.login, path: .path, line: .line, body: .body, html_url: .html_url}'

echo
echo "== SEO workflow =="
sed -n '1,220p' .github/workflows/seo-audit.yml

Length of output: 39424


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="AOSSIE-Org/SocialShareButton"
pr="229"
head_sha=$(gh api "repos/$repo/pulls/$pr" --jq '.head.sha')

echo "== Pull request issue comments from Socket =="
gh api "repos/$repo/issues/$pr/comments" --paginate \
  --jq '.[] | select((.user.login | ascii_downcase | contains("socket")) or (.body | ascii_downcase | contains("socket"))) | {user: .user.login, body: .body, html_url: .html_url}'

echo
echo "== Check runs on PR head =="
gh api -H "Accept: application/vnd.github+json" \
  "repos/$repo/commits/$head_sha/check-runs" --paginate \
  --jq '.check_runs[] | select((.name | ascii_downcase | contains("socket")) or (.app.slug | ascii_downcase | contains("socket"))) | {name: .name, app: .app.slug, status: .status, conclusion: .conclusion, details_url: .details_url, output: .output}'

echo
echo "== Commit statuses on PR head =="
gh api "repos/$repo/commits/$head_sha/status" \
  --jq '.statuses[] | select(.context | ascii_downcase | contains("socket")) | {context: .context, state: .state, description: .description, target_url: .target_url}'

Length of output: 24903


@amankv1234 Yes. Socket reports a supply-chain security warning in this PR.

What Socket found

The new workflow adds these direct Python dependencies:

  • requests@2.34.2
  • beautifulsoup4@4.15.0
  • extruct@0.18.0

Socket gives these direct packages a vulnerability score of 100, so it does not report a known vulnerability in them.

However, extruct@0.18.0 installs this transitive dependency:

extruct@0.18.0 → pyrdfa3@3.6.5

Socket flags pyrdfa3@3.6.5 as 90% likely to contain obfuscated code. Obfuscated code is difficult to inspect. It can hide unsafe or malicious behavior. Socket marks this as High severity and Warn.

Socket displays the alert twice because it detected it in both package formats:

  • source archive (tar.gz)
  • Python wheel (.whl)

This is one underlying dependency concern, not two separate packages.

Security impact

This does not prove that the project is compromised. It is a supply-chain risk that needs review.

The affected package runs in the GitHub Actions SEO audit workflow. It does not become part of the deployed landing-page application. The workflow also reduces the impact because it uses:

permissions:
  contents: read

and:

persist-credentials: false

Recommended action

Do not ignore the alert without review.

  1. Check whether extruct is necessary for the JSON-LD validation.
  2. If it is not necessary, remove extruct and parse the JSON-LD blocks with a smaller dependency set.
  3. If it is necessary, review pyrdfa3@3.6.5 and its maintainership before accepting the risk.
  4. Prefer a maintained extruct version or an alternative that does not depend on pyrdfa3, if available.
  5. Use Socket's ignore command only after the maintainers accept the risk.

The Socket check is marked success because the organization configured this result as a warning. It does not mean the warning is resolved.

🐇🔍

You are interacting with an AI system.

@amankv1234

Copy link
Copy Markdown
Contributor Author

@CodeRabbit, how to solve the give explaine by you in above

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Workflow outline =='
ast-grep outline .github/workflows/seo-audit.yml --items all || true

printf '%s\n' '== SEO audit workflow =='
cat -n .github/workflows/seo-audit.yml

printf '%s\n' '== Audit requirements =='
cat -n .github/requirements-audit.txt

printf '%s\n' '== extruct and pyrdfa3 references =='
rg -n -C 4 --hidden -g '!**/.git/**' '\b(extruct|pyrdfa3)\b' .

Length of output: 7068


@amankv1234, remove extruct from this workflow. This removes the dependency path that Socket flagged:

extruct → pyrdfa3

The workflow only uses extruct to find JSON-LD blocks. It can do this with BeautifulSoup and Python’s built-in json module.

Remove the flagged dependency and validate JSON-LD directly

  • Remove extruct from .github/requirements-audit.txt.
  • Remove import extruct from .github/workflows/seo-audit.yml.
  • Parse each <script type="application/ld+json"> block with json.loads.
  • Fail the workflow if no JSON-LD block exists or if a JSON-LD block is invalid.

  • 📌 Create a pull request with these changes

You are interacting with an AI system.

@amankv1234

Copy link
Copy Markdown
Contributor Author

@CodeRabbit, Check this i have update the code whatever you had suggested to me to change and let me know if any issue

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Changed files =='
git diff --name-status "$(git merge-base HEAD origin/main)" HEAD

printf '%s\n' '== Audit requirements =='
cat -n .github/requirements-audit.txt

printf '%s\n' '== SEO audit workflow =='
cat -n .github/workflows/seo-audit.yml

printf '%s\n' '== extruct and pyrdfa3 references =='
rg -n -i -C 3 '\b(extruct|pyrdfa3)\b' \
  .github/requirements-audit.txt .github/workflows/seo-audit.yml || true

printf '%s\n' '== Workflow YAML parse =='
python3 - <<'PY'
from pathlib import Path
import yaml

path = Path(".github/workflows/seo-audit.yml")
with path.open(encoding="utf-8") as file:
    data = yaml.safe_load(file)
print("YAML parsed successfully.")
print("Top-level keys:", list(data))
PY

Length of output: 6493


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Diff whitespace check =='
git diff --check "$(git merge-base HEAD origin/main)" HEAD

printf '%s\n' '== YAML syntax check with Ruby standard library =='
ruby -e 'require "yaml"; YAML.load_file(".github/workflows/seo-audit.yml"); puts "YAML parsed successfully."' \
  || printf '%s\n' 'Ruby YAML parser is unavailable or rejected the workflow.'

printf '%s\n' '== Exact JSON-LD validation block =='
sed -n '90,107l' .github/workflows/seo-audit.yml

printf '%s\n' '== Dependency specifiers =='
cat .github/requirements-audit.txt

Length of output: 1196


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '== YAML syntax check with Ruby standard library =='
if command -v ruby >/dev/null 2>&1; then
  ruby -e 'require "yaml"; YAML.load_file(".github/workflows/seo-audit.yml"); puts "YAML parsed successfully."'
else
  printf '%s\n' 'Ruby is unavailable.'
fi

printf '%s\n' '== JSON-LD validation block =='
sed -n '90,107p' .github/workflows/seo-audit.yml

printf '%s\n' '== Trailing-whitespace locations =='
git diff --check "$(git merge-base HEAD origin/main)" HEAD || true

Length of output: 1881


@amankv1234, the Socket security issue is resolved.

extruct is removed from .github/requirements-audit.txt. The workflow has no extruct or pyrdfa3 reference. This removes the dependency path that Socket flagged.

The workflow YAML is valid.

Please fix these two items before merge:

  1. Remove trailing whitespace from .github/workflows/seo-audit.yml at Line 77, Line 80, Line 82, and Line 102.

  2. Update the JSON-LD validation. The current if tag.string: silently skips empty JSON-LD blocks. It can also skip a block when BeautifulSoup does not provide .string. The check must fail for every empty or invalid JSON-LD block.

Replace the current JSON-LD loop with:

for index, tag in enumerate(script_tags, start=1):
    raw_json_ld = tag.get_text(strip=True)
    assert raw_json_ld, f"CRITICAL: JSON-LD block {index} is empty."

    try:
        json.loads(raw_json_ld)
    except json.JSONDecodeError as error:
        raise AssertionError(
            f"CRITICAL: JSON-LD block {index} is invalid: {error}"
        ) from error

This change preserves the intended security fix and makes the JSON-LD validation complete.

You are interacting with an AI system.

@amankv1234

amankv1234 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@CodeRabbit, Now everything is done check and let me know any issue till if no any issue pass the checks

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="$(git merge-base HEAD origin/main)"

printf '%s\n' '== Changed files =='
git diff --name-status "$base" HEAD

printf '%s\n' '== Requirements =='
cat -n .github/requirements-audit.txt

printf '%s\n' '== Workflow =='
cat -n .github/workflows/seo-audit.yml

printf '%s\n' '== Removed dependency references =='
rg -n -i -C 2 '\b(extruct|pyrdfa3)\b' \
  .github/requirements-audit.txt .github/workflows/seo-audit.yml || true

printf '%s\n' '== Diff whitespace check =='
git diff --check "$base" HEAD

printf '%s\n' '== YAML parse =='
ruby -e 'require "yaml"; YAML.load_file(".github/workflows/seo-audit.yml"); puts "YAML parsed successfully."'

printf '%s\n' '== JSON-LD validation references =='
rg -n -C 8 'json_ld|script_tags|json\.loads|get_text' .github/workflows/seo-audit.yml

Length of output: 7863


@amankv1234, I found no remaining issue in the items reviewed.

  • The workflow no longer installs extruct.
  • The extruct → pyrdfa3 dependency path is removed.
  • No extruct or pyrdfa3 reference remains in the audit files.
  • The workflow has no diff whitespace errors.
  • The workflow YAML parses successfully.
  • The JSON-LD validation now checks every matching script block.
  • The JSON-LD validation fails for an empty or invalid block.

The previous Socket supply-chain warning should be resolved after Socket runs again on the updated commit.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="$(git merge-base HEAD origin/main)"

printf '%s\n' '== Changed files =='
git diff --name-status "$base" HEAD

printf '%s\n' '== Whitespace errors =='
git diff --check "$base" HEAD

printf '%s\n' '== Audit dependencies =='
cat -n .github/requirements-audit.txt

printf '%s\n' '== Flagged dependency references =='
rg -n -i -C 3 '\b(extruct|pyrdfa3)\b' \
  .github/requirements-audit.txt .github/workflows/seo-audit.yml || true

printf '%s\n' '== Workflow JSON-LD validation and relevant imports =='
rg -n -C 10 '^\s*import json\b|script_tags|json\.loads|get_text\(strip=True\)|application/ld\+json' \
  .github/workflows/seo-audit.yml

printf '%s\n' '== Complete workflow =='
cat -n .github/workflows/seo-audit.yml

printf '%s\n' '== Lighthouse configuration =='
cat -n .lighthouserc.json

printf '%s\n' '== Current PR check runs =='
repo="AOSSIE-Org/SocialShareButton"
pr="229"
head_sha="$(gh api "repos/$repo/pulls/$pr" --jq '.head.sha')"
gh api -H 'Accept: application/vnd.github+json' \
  "repos/$repo/commits/$head_sha/check-runs" --paginate \
  --jq '.check_runs[] | {name, status, conclusion, details_url}'

Length of output: 10854


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="AOSSIE-Org/SocialShareButton"

printf '%s\n' '== SEO audit failed-step log =='
gh run view 31310661696 \
  --repo "$repo" \
  --job 93237884085 \
  --log-failed || true

printf '%s\n' '== Dependency and License Review failed-step log =='
gh run view 31310661689 \
  --repo "$repo" \
  --job 93237883936 \
  --log-failed || true

printf '%s\n' '== Job metadata =='
for job_id in 93237884085 93237883936; do
  gh api "repos/$repo/actions/jobs/$job_id" \
    --jq '{name, conclusion, started_at, completed_at, steps: [.steps[] | {name, status, conclusion, number}]}' || true
done

Length of output: 10367


@amankv1234, I cannot pass the checks yet. Two checks still fail.

  1. seo-and-crawl-audit fails because the crawler input name is incorrect.

    In .github/workflows/seo-audit.yml, replace:

    website-url: 'https://social-share-button.aossie.org/'

    with:

    website_url: 'https://social-share-button.aossie.org/'

    The action accepts website_url with an underscore. The current website-url input does not set INPUT_WEBSITE_URL, so the crawler exits before Lighthouse and the Python validations run.

  2. Dependency & License Review fails because GitHub Dependency graph is disabled.

    A repository administrator must enable it at:

    https://github.com/AOSSIE-Org/SocialShareButton/settings/security_analysis

    Enable Dependency graph. Then rerun the failed check.

The Socket checks pass. The previous extruct → pyrdfa3 supply-chain warning is resolved. The JSON-LD validation also has the required empty and invalid block checks.

After you apply the website_url correction and enable Dependency graph, rerun the failed checks.

You are interacting with an AI system.

@amankv1234

Copy link
Copy Markdown
Contributor Author

@CodeRabbit , check again and let me know why Coderabbit suggest changes and tell what is the changes needed

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="AOSSIE-Org/SocialShareButton"
pr="229"
base="$(git merge-base HEAD origin/main)"

printf '%s\n' '== Changed files =='
git diff --name-status "$base" HEAD

printf '%s\n' '== Workflow =='
cat -n .github/workflows/seo-audit.yml

printf '%s\n' '== Audit requirements =='
cat -n .github/requirements-audit.txt

printf '%s\n' '== Lighthouse configuration =='
cat -n .lighthouserc.json

printf '%s\n' '== Current CodeRabbit review comments =='
gh api "repos/$repo/pulls/$pr/comments" --paginate --jq \
  '.[] | select(.user.login == "coderabbitai[bot]" or .user.login == "coderabbitai") |
   {path, line, side, body, html_url, created_at}'

printf '%s\n' '== Current CodeRabbit PR reviews =='
gh api "repos/$repo/pulls/$pr/reviews" --paginate --jq \
  '.[] | select(.user.login == "coderabbitai[bot]" or .user.login == "coderabbitai") |
   {state, body, submitted_at, html_url}'

printf '%s\n' '== Recent PR issue comments from CodeRabbit =='
gh api "repos/$repo/issues/$pr/comments" --paginate --jq \
  '.[] | select(.user.login == "coderabbitai[bot]" or .user.login == "coderabbitai") |
   {body, created_at, html_url}' | tail -n 10

printf '%s\n' '== Current check runs =='
head_sha="$(gh api "repos/$repo/pulls/$pr" --jq '.head.sha')"
gh api -H 'Accept: application/vnd.github+json' \
  "repos/$repo/commits/$head_sha/check-runs" --paginate \
  --jq '.check_runs[] | {name, app: .app.slug, status, conclusion, details_url}'

Length of output: 87560


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="AOSSIE-Org/SocialShareButton"

printf '%s\n' '== SEO audit failure log =='
gh run view 31311008156 --repo "$repo" --job 93238723239 --log-failed || true

printf '%s\n' '== Dependency and License Review failure log =='
gh run view 31311008126 --repo "$repo" --job 93238722988 --log-failed || true

printf '%s\n' '== Failed job metadata =='
for job_id in 93238723239 93238722988; do
  gh api "repos/$repo/actions/jobs/$job_id" \
    --jq '{name, conclusion, started_at, completed_at, steps: [.steps[] | {name, number, status, conclusion}]}'
done

Length of output: 75343


@amankv1234, I checked the current workflow and the failed job logs.

Why CodeRabbit suggested changes

CodeRabbit reviewed this PR with the ASSERTIVE profile. It reports workflow security, CI reliability, and functional correctness risks.

Most earlier comments are already fixed:

  • Workflow concurrency exists.
  • permissions: contents: read exists.
  • persist-credentials: false exists.
  • Actions use full commit SHA pins.
  • The crawler uses the correct website_url input.
  • HTTP timeouts and the TTFB budget exist.
  • Canonical and JSON-LD validation exist.
  • extruct and pyrdfa3 are removed.

The earlier crawler-input issue is resolved. The crawler completed successfully in the latest failed run.

Required changes

1. Fix the Lighthouse failure

The current failure is not caused by the crawler.

.lighthouserc.json contains:

"preset": "lighthouse:recommended"

This preset enables many additional Lighthouse checks as error-level merge gates. The run failed on checks such as:

  • aria-hidden-focus
  • color-contrast
  • csp-xss
  • heading-order
  • image-aspect-ratio
  • link-text
  • total-byte-weight

The configured category threshold also failed:

Accessibility: expected >= 0.90, found 0.88

You must choose one of these options:

  1. Keep the strict audit.
    Fix the landing-page accessibility and best-practice findings. This is the recommended option. Do not lower the accessibility threshold only to make CI pass.

  2. Audit only the four category scores defined by this PR.
    Remove "preset": "lighthouse:recommended" from .lighthouserc.json. Keep the explicit category assertions.
    The workflow will still fail until accessibility reaches 0.90, because the current score is 0.88.

The first specific accessibility issues to fix are:

  • Remove focusable elements from containers with aria-hidden="true".
  • Correct foreground/background color contrast.
  • Correct heading order.
  • Add descriptive text or accessible labels to links.

2. Make pull request audits test the pull request

This is the one remaining unresolved CodeRabbit review comment.

The workflow checks this fixed URL in every event:

https://social-share-button.aossie.org/

For a pull request, that is the current production site. It does not test the changes in the pull request.

Use a deployment preview URL for pull_request runs. Use the production URL only for push and workflow_dispatch runs.

If the project has no preview deployment provider, build and serve the checked-out landing page in the workflow. Then pass the local URL to the crawler, Lighthouse, and Python validation steps.

3. Enable GitHub Dependency graph

Dependency & License Review failed with:

Dependency review is not supported on this repository.
Please ensure that Dependency graph is enabled.

A repository administrator must enable Dependency graph in the repository security settings:

https://github.com/AOSSIE-Org/SocialShareButton/settings/security_analysis

This is a repository setting. A workflow or source-code change cannot fix it.

Non-blocking warning

GitHub warns that actions/checkout, treosh/lighthouse-ci-action, and actions/dependency-review-action target Node.js 20. GitHub currently runs them with Node.js 24. This warning does not fail the job. Update those action pins when the action maintainers publish compatible releases.

  • Select the intended Lighthouse policy and make the Lighthouse assertions match that policy.
  • Fix the landing-page accessibility failures if the 0.90 accessibility threshold remains required.
  • Configure a pull-request preview URL or local preview server so PR audits validate the pull-request revision.
  • Enable GitHub Dependency graph, then rerun the failed Dependency Review check.

  • 📌 Create a pull request with these changes

You are interacting with an AI system.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (5)
.github/workflows/seo-audit.yml (5)

88-90: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Validate the canonical URL and uniqueness.

soup.find() accepts duplicate canonical elements. The current assertion also accepts an empty or incorrect href. Require exactly one canonical element and compare its normalized URL with https://social-share-button.aossie.org/.

🤖 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/seo-audit.yml around lines 88 - 90, Update the canonical
validation around soup.find to collect all rel='canonical' elements, require
exactly one, and validate that its normalized href equals
https://social-share-button.aossie.org/. Preserve the diagnostic output while
ensuring missing, duplicate, empty, or incorrect canonical URLs fail the
assertion.

78-83: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Make the HTTP probe a bounded enforcement gate.

requests.get has no timeout. A stalled endpoint can block the job. The code also only prints the response time, so an excessive TTFB passes the audit. Set connect and read timeouts, then assert a documented time budget.

🤖 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/seo-audit.yml around lines 78 - 83, Update the HTTP probe
around requests.get to use explicit bounded connect and read timeouts, and
enforce the documented TTFB budget by asserting response.elapsed.total_seconds()
does not exceed it. Keep the existing status-code assertion and ensure the
timeout and budget values are clearly defined for the audit.

15-15: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Pin all actions to immutable commit SHAs.

Each uses: reference still uses a mutable tag. This violates the configured static-analysis policy and permits an action tag to change after review.

Also applies to: 18-18, 44-44, 50-50, 59-59

🤖 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/seo-audit.yml at line 15, Update every uses: reference in
the seo-audit workflow, including actions/checkout@v4 and the references at the
indicated locations, to immutable commit SHA pins. Preserve each action and its
behavior while replacing mutable tags with the corresponding full-length commit
SHAs.

Source: Linters/SAST tools


49-55: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Use one Lighthouse target URL contract.

The workflow selects production for push and manual runs, but .lighthouserc.json hard-codes localhost. The workflow also does not explicitly load this configuration. Depending on action behavior, assertions can be skipped or production runs can target a non-existent local server.

  • .github/workflows/seo-audit.yml#L49-L55: explicitly load the assertion configuration and pass the selected audit URL through the supported action interface.
  • .lighthouserc.json#L3-L5: remove the fixed localhost collection URL or generate the configuration from the selected audit URL.
🤖 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/seo-audit.yml around lines 49 - 55, The Lighthouse
workflow and configuration use inconsistent target URL contracts. In
.github/workflows/seo-audit.yml lines 49-55, explicitly load .lighthouserc.json
and pass env.AUDIT_URL through the Lighthouse action’s supported URL interface;
in .lighthouserc.json lines 3-5, remove the hard-coded localhost collection URL
or generate it from the selected audit URL so production and local runs target
the same URL.

63-65: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove extruct and validate every JSON-LD block directly.

This reintroduces the dependency path that the PR objective states was removed for the Socket warning. It also only requires one extracted object, so an invalid JSON-LD script can pass when another script is valid.

  • .github/workflows/seo-audit.yml#L63-L65: install only the committed audit requirements needed for requests and BeautifulSoup.
  • .github/workflows/seo-audit.yml#L75-L75: remove the extruct import.
  • .github/workflows/seo-audit.yml#L98-L101: find every application/ld+json script and parse each block with json.loads; fail on empty or invalid blocks.
🤖 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/seo-audit.yml around lines 63 - 65, Update
.github/workflows/seo-audit.yml at lines 63-65 to install only the committed
requirements for requests and BeautifulSoup, remove the extruct import at lines
75-75, and update the JSON-LD validation at lines 98-101 to locate every
application/ld+json script, parse each block with json.loads, and fail when any
block is empty or invalid.
🤖 Prompt for all review comments with 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.

Duplicate comments:
In @.github/workflows/seo-audit.yml:
- Around line 88-90: Update the canonical validation around soup.find to collect
all rel='canonical' elements, require exactly one, and validate that its
normalized href equals https://social-share-button.aossie.org/. Preserve the
diagnostic output while ensuring missing, duplicate, empty, or incorrect
canonical URLs fail the assertion.
- Around line 78-83: Update the HTTP probe around requests.get to use explicit
bounded connect and read timeouts, and enforce the documented TTFB budget by
asserting response.elapsed.total_seconds() does not exceed it. Keep the existing
status-code assertion and ensure the timeout and budget values are clearly
defined for the audit.
- Line 15: Update every uses: reference in the seo-audit workflow, including
actions/checkout@v4 and the references at the indicated locations, to immutable
commit SHA pins. Preserve each action and its behavior while replacing mutable
tags with the corresponding full-length commit SHAs.
- Around line 49-55: The Lighthouse workflow and configuration use inconsistent
target URL contracts. In .github/workflows/seo-audit.yml lines 49-55, explicitly
load .lighthouserc.json and pass env.AUDIT_URL through the Lighthouse action’s
supported URL interface; in .lighthouserc.json lines 3-5, remove the hard-coded
localhost collection URL or generate it from the selected audit URL so
production and local runs target the same URL.
- Around line 63-65: Update .github/workflows/seo-audit.yml at lines 63-65 to
install only the committed requirements for requests and BeautifulSoup, remove
the extruct import at lines 75-75, and update the JSON-LD validation at lines
98-101 to locate every application/ld+json script, parse each block with
json.loads, and fail when any block is empty or invalid.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 886da7e1-90aa-4252-b446-b0eb880a3356

📥 Commits

Reviewing files that changed from the base of the PR and between 94696bd and da3182f.

📒 Files selected for processing (3)
  • .github/requirements-audit.txt
  • .github/workflows/seo-audit.yml
  • .lighthouserc.json
💤 Files with no reviewable changes (1)
  • .github/requirements-audit.txt

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In @.github/workflows/seo-audit.yml:
- Around line 46-48: Update the PR link-audit step using
Broken-Links-Crawler-Action so the crawler can reach the server started on the
runner at AUDIT_URL (localhost:3000). Replace the Docker-based action path with
a runner-hosted crawler, or place the site and crawler on a shared container
network using a reachable service hostname, while preserving the existing audit
target behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0563f1ae-2fbc-487e-b670-6b430c8c0520

📥 Commits

Reviewing files that changed from the base of the PR and between da3182f and 17826cb.

📒 Files selected for processing (2)
  • .github/workflows/seo-audit.yml
  • .lighthouserc.json
💤 Files with no reviewable changes (1)
  • .lighthouserc.json

Comment thread .github/workflows/seo-audit.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd CI/CD pipeline changes configuration Configuration file changes documentation Changes to documentation files github-actions GitHub Actions workflow changes javascript JavaScript/TypeScript code changes needs-review no-issue-linked PR is not linked to any issue repeat-contributor PR from an external contributor who already had PRs merged size/M Medium PR (51-200 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant