{"slug": "show-hn-github-action-to-check-ai-written-code-changes-no-files-without-review", "title": "Show HN: GitHub Action to check AI-written code changes no files, without review", "summary": "A developer released a GitHub Action, yuyuyuyuyu-dev/assert-no-unexpected-changes, that runs an AI-written code change in two Docker containers — one executing only the `arrange` setup phase and one running both `arrange` and `act` — then compares them with `docker diff` to flag files created, changed or deleted outside a user-supplied allowlist. The action fails the step with an error such as \"2 change(s) outside the allowlist\" when violations appear, and is configured through `arrange`, `act`, `allowlist`, `workdir` and `image` inputs on a Linux runner. The author built it after deciding that \"something strange\" from AI-generated code most plausibly means files deleted or rewritten without the user's knowledge.", "body_md": "This action asserts that your desktop app, CLI tool or anything else makes no unexpected changes.\n\n**Table of Contents**\n\nThis GitHub Action was built to verify that code an AI wrote does nothing \"strange\", treating the code as a black box.\n\nI was about to post on social media that I had built a desktop app when a thought stopped me: if I say an AI built it, some people are going to worry that it will do something strange to their machine. So I asked myself what \"something strange\" would actually be, and the first answer that came to mind was files deleted or rewritten behind their back. Nothing seemed to exist that would catch it, and if a thing does not exist, you may as well make it, so I wrote this action.\n\nThis action prepares two Docker containers: one runs only the `arrange` phase, and the other runs both the `arrange` and `act` phases.\nMore precisely, it writes a Dockerfile that starts from `image`, copies the workspace (` GITHUB_WORKSPACE`) into `workdir` with `COPY` and runs the `arrange` phase, and builds an image from it.\nFrom that image it starts two containers, runs the `act` phase in only one of them, and runs `docker diff` on both.\nThen it checks the difference between the two containers against `allowlist` to detect violations.\nIf there are any, the step fails with an error like this:\n\n```\nError: 2 change(s) outside the allowlist\nA /unexpected\nD /expected\n```\n\n`A` means created, `C` means changed and `D` means deleted.\n\n```\n# Please replace ${checkout-latest-version} and ${this-action-latest-version} with the latest version numbers, such as `v1`.\nruns-on: ubuntu-latest # Must be a Linux runner.\nsteps:\n  - uses: actions/checkout@${checkout-latest-version}\n  - uses: yuyuyuyuyu-dev/assert-no-unexpected-changes@${this-action-latest-version}\n    with:\n      arrange: | # Optional. Run in `sh`. Its changes are not checked.\n        some-setup-commands\n        for-example-install-the-dependencies\n        build-the-thing\n        or-anything-else\n      act: | # Run in `sh`. Its changes are checked.\n        some-commands-to-verify\n        for-example-run-tests\n        ./the-built-executable\n        or-anything-else\n      allowlist: | # Optional. Absolute paths that may change, one per line. `*` also matches `/`.\n        /this/path/alone\n        /everything/below/this/*\n      workdir: /path/to/workdir # Optional. Defaults to `/workdir`. Changes under it are not checked.\n      image: some-image:a-tag # Optional. Defaults to Ubuntu. Must run as root to change the copied workspace.\n```\n\n", "url": "https://wpnews.pro/news/show-hn-github-action-to-check-ai-written-code-changes-no-files-without-review", "canonical_source": "https://github.com/yuyuyuyuyu-dev/assert-no-unexpected-changes", "published_at": "2026-10-07 07:41:52+00:00", "updated_at": "2026-10-07 07:49:05.468336+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-safety", "ai-agents"], "entities": ["GitHub Actions", "Docker", "yuyuyuyuyu-dev/assert-no-unexpected-changes", "Ubuntu", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-github-action-to-check-ai-written-code-changes-no-files-without-review", "markdown": "https://wpnews.pro/news/show-hn-github-action-to-check-ai-written-code-changes-no-files-without-review.md", "text": "https://wpnews.pro/news/show-hn-github-action-to-check-ai-written-code-changes-no-files-without-review.txt", "jsonld": "https://wpnews.pro/news/show-hn-github-action-to-check-ai-written-code-changes-no-files-without-review.jsonld"}}