Skip to content

AITS-422: Cache dev-docs scrape retries - #39

Merged
doconnell2020 merged 4 commits into
mainfrom
aits-422-cache-devdocs-scrape
Jul 14, 2026
Merged

AITS-422: Cache dev-docs scrape retries#39
doconnell2020 merged 4 commits into
mainfrom
aits-422-cache-devdocs-scrape

Conversation

@doconnell2020

Copy link
Copy Markdown
Contributor

Summary

  • Cache the dev-docs scrape snapshot only for reruns of the same monthly workflow run.
  • Skip scraping when the restored snapshot includes _manifest.json, then compile dev-docs directly from that snapshot.
  • Keep local scrape artifacts out of version control and report the snapshot page count in the generated refresh PR.

Refs AITS-422

Validation

  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/monthly-llmwiki-refresh.yml"); puts "yaml ok"'
  • git diff --check
  • Verified the exact cache key includes github.run_id, no restore-keys are present, and .llmwiki-cache/ is ignored.

The selected LLMWiki main ref was previously confirmed to support wiki scrape --output-dir and wiki compile --sources-root.


- name: Save dev-docs scrape cache
if: steps.devdocs-scrape-cache.outputs.cache-hit != 'true' && hashFiles('.llmwiki-cache/dev-docs-sources/_manifest.json') != ''
uses: actions/cache/save@v4

@semgrep-code-team-telnyx semgrep-code-team-telnyx Bot Jul 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

🧼 Fixed in commit 04c4223 🧼


- name: Restore dev-docs scrape cache
id: devdocs-scrape-cache
uses: actions/cache/restore@v4

@semgrep-code-team-telnyx semgrep-code-team-telnyx Bot Jul 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

🧁 Fixed in commit 04c4223 🧁

Comment on lines 16 to 20
- name: Checkout PR
uses: actions/checkout@v7
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Semgrep identified an issue in your code:
This GitHub Actions workflow file uses pull_request_target and checks out code from the incoming pull request. When using pull_request_target, the Action runs in the context of the target repository, which includes access to all repository secrets. Normally, this is safe because the Action only runs code from the target repository, not the incoming PR. However, by checking out the incoming PR code, you're now using the incoming code for the rest of the action. You may be inadvertently executing arbitrary code from the incoming PR with access to repository secrets, which would let an attacker steal repository secrets. This normally happens by running build scripts (e.g., npm build and make) or dependency installation scripts (e.g., python setup.py install). Audit your workflow file to make sure no code from the incoming PR is executed. Please see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ for additional mitigations.

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by pull-request-target-code-checkout.

You can view more details about this finding in the Semgrep AppSec Platform.

@doconnell2020
doconnell2020 merged commit 5c2d06b into main Jul 14, 2026
6 of 7 checks passed
@doconnell2020
doconnell2020 deleted the aits-422-cache-devdocs-scrape branch July 20, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant