Skip to content

Add AI-HPP v4.2 auto-archive workflow#69

Open
tryblackjack wants to merge 1 commit intomainfrom
codex/add-auto-archive-workflow-#4
Open

Add AI-HPP v4.2 auto-archive workflow#69
tryblackjack wants to merge 1 commit intomainfrom
codex/add-auto-archive-workflow-#4

Conversation

@tryblackjack
Copy link
Copy Markdown
Owner

Motivation

  • Add the AI-HPP v4.2 auto-archive workflow to enforce the canonical root layout and automatically move unexpected root items into archive/<date>/auto/ without deleting anything.
  • Ensure the new workflow is deterministic, minimal, and runs on ubuntu-latest using actions/checkout@v4 to match the v4.2 rules.

Description

  • Replaced the existing .github/workflows/auto-archive.yml contents with the provided AI-HPP v4.2 workflow that installs actions/setup-python@v5 and runs a shell auto-archive script.
  • The workflow enforces the allowed root items list, builds a grep-safe PATTERN, moves unexpected items into archive/$(date +%Y-%m-%d)/auto/, and writes a .reason file next to each moved item.
  • Adjusted the job name to archive and added a Commit & Push step that configures author identity and pushes changes if any root items were archived.

Testing

  • Listed existing workflows with ls -1 .github/workflows to confirm detected files before modification and ensure no unexpected files were targeted. (succeeded)
  • Validated the new YAML file syntax using Ruby's YAML.load_file which parsed .github/workflows/auto-archive.yml successfully. (succeeded)
  • Attempted Python pyyaml validation but pip installation failed due to environment package/proxy restrictions, so Ruby validation was used instead. (pip/pyyaml install failed, YAML parse via Ruby succeeded)
  • Ran git status --short to verify that the only pending change was the updated auto-archive.yml workflow file. (succeeded)

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0aee5f3685

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

mkdir -p archive/$(date +%Y-%m-%d)/auto

# Convert allowed list into grep pattern
PATTERN=$(printf "%s\n" "${ALLOWED[@]}" | paste -sd "|" -)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escape allowed names before regex matching

Building PATTERN by joining raw filenames makes grep -E treat metacharacters in allowed names as regex operators, so entries like README.md and .gitignore match unintended names (for example READMEXmd), which lets non-canonical root items bypass archiving. Quote or escape each allowed literal before composing the alternation so matching stays exact.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant