{"path":".github/strip-ai-attribution.yml","size":1868,"locked":false,"binary":false,"truncated":false,"content":"# .github/workflows/strip-ai-attribution.yml\nname: Strip AI Attribution\n\non:\n  pull_request:\n    types: [opened, synchronize, reopened]\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  strip-attribution:\n    runs-on: ubuntu-latest\n    if: github.event.pull_request.user.login == 'devin-ai-integration[bot]' || contains(github.event.pull_request.user.login, 'devin')\n    steps:\n      - name: Checkout PR branch\n        uses: actions/checkout@v4\n        with:\n          ref: ${{ github.event.pull_request.head.ref }}\n          fetch-depth: 0\n          token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Rewrite commit messages to remove AI attribution\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n          git filter-branch --force --msg-filter '\n            grep -v -iE \"^Co-[Aa]uthored-[Bb]y:.*(devin|cognition)\" | \\\n            grep -v -iE \"generated (with|by) \\[?devin\" | \\\n            grep -v \"^🤖\"\n          ' -- ${{ github.event.pull_request.base.ref }}..HEAD\n          git push --force origin HEAD:${{ github.event.pull_request.head.ref }}\n\n      - name: Strip PR description footer\n        uses: actions/github-script@v7\n        with:\n          script: |\n            const body = context.payload.pull_request.body || \"\";\n            const cleaned = body\n              .split(\"\\n\")\n              .filter(line => !/co-authored-by.*devin/i.test(line))\n              .filter(line => !/generated with \\[?devin/i.test(line))\n              .join(\"\\n\");\n            if (cleaned !== body) {\n              await github.rest.pulls.update({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                pull_number: context.payload.pull_request.number,\n                body: cleaned,\n              });\n            }\n"}