{"id":25898143,"url":"https://github.com/coderrob/add-copyright","last_synced_at":"2026-05-12T15:31:47.726Z","repository":{"id":280074010,"uuid":"932425971","full_name":"Coderrob/add-copyright","owner":"Coderrob","description":"GitHub Action to add a copyright message to all applicable source files.","archived":false,"fork":false,"pushed_at":"2026-03-11T19:18:55.000Z","size":6390,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-12T00:40:45.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coderrob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-13T22:25:00.000Z","updated_at":"2025-09-08T20:53:39.000Z","dependencies_parsed_at":"2025-03-01T04:34:20.213Z","dependency_job_id":null,"html_url":"https://github.com/Coderrob/add-copyright","commit_stats":null,"previous_names":["coderrob/add-copyright"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Coderrob/add-copyright","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fadd-copyright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fadd-copyright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fadd-copyright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fadd-copyright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coderrob","download_url":"https://codeload.github.com/Coderrob/add-copyright/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fadd-copyright/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32945291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-03T00:17:13.534Z","updated_at":"2026-05-12T15:31:47.716Z","avatar_url":"https://github.com/Coderrob.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg\n    src=\"public/img/add-copyright-logo-small.png\"\n    alt=\"Barrel Roll logo\"\n  /\u003e\n\u003c/p\u003e\n\n# Copyright and License\n\n[![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=for-the-badge\u0026logo=github-actions\u0026logoColor=white)](https://github.com/features/actions)\n\n[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)](https://github.com/Coderrob/add-copyright)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![SPDX](https://img.shields.io/badge/SPDX--License--List-3.20-blue.svg)](https://spdx.org/licenses/)\n\nA GitHub Action that automatically adds copyright headers and full license texts to source files based on SPDX license identifiers. Supports 700+ current open-source licenses with automatic monthly updates from the official SPDX License List Data repository. Ensures compliance and consistency across your codebase.\n\n## ✨ Features\n\n- **700+ Licenses**: Support for all current SPDX license identifiers\n- **Multi-Language**: Handles 15+ programming languages with appropriate comment styles\n- **Smart Detection**: Skips files that already have current copyright notices\n- **Git Integration**: Respects `.gitignore` and common config file exclusions\n- **Auto-Updates**: Monthly license database updates from SPDX\n- **Flexible**: Works with any directory structure and file types\n\n## 📋 Table of Contents\n\n- [Quick Start](#-quick-start)\n- [Inputs](#-inputs)\n- [Outputs](#-outputs)\n- [Supported Languages](#-supported-languages)\n- [Examples](#-examples)\n- [License Updates](#-license-updates)\n- [Local Development](#-local-development)\n- [Contributing](#-contributing)\n- [Troubleshooting](#-troubleshooting)\n- [License](#-license)\n- [Changelog](CHANGELOG.md)\n\n## 🚀 Quick Start\n\n```yaml\njobs:\n  add-copyright:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Add Copyright Headers\n        uses: Coderrob/add-copyright@v1\n        with:\n          name: \"Your Company Name\"\n          license: \"MIT\"\n          working-directory: \"src\"\n```\n\n## 📝 Inputs\n\n| Name                | Description                                                                   | Required | Default | Example        |\n| ------------------- | ----------------------------------------------------------------------------- | -------- | ------- | -------------- |\n| `name`              | Name of the copyright holder                                                  | ✅ Yes   | -       | `\"Acme Corp\"`  |\n| `license`           | SPDX license identifier (see [SPDX License List](https://spdx.org/licenses/)) | ✅ Yes   | -       | `\"Apache-2.0\"` |\n| `working-directory` | Directory to scan for source files                                            | ❌ No    | `.`     | `\"src\"`        |\n\n## 📤 Outputs\n\nThis action does not define any outputs.\n\n## 💻 Supported Languages\n\nThe action automatically detects file types and applies appropriate comment styles:\n\n| Language   | Extensions                 | Comment Style |\n| ---------- | -------------------------- | ------------- |\n| Shell/Bash | `.sh`, `.bash`             | `#`           |\n| Python     | `.py`                      | `#`           |\n| JavaScript | `.js`                      | `/* */`       |\n| TypeScript | `.ts`                      | `/* */`       |\n| Java       | `.java`                    | `/* */`       |\n| C/C++      | `.c`, `.cpp`, `.h`, `.hpp` | `/* */`       |\n| C#         | `.cs`                      | `/* */`       |\n| Go         | `.go`                      | `//`          |\n| Swift      | `.swift`                   | `//`          |\n| PHP        | `.php`                     | `/* */`       |\n| Ruby       | `.rb`                      | `#`           |\n| YAML       | `.yml`, `.yaml`            | `#`           |\n\n## 📚 Examples\n\n### Basic Usage\n\n```yaml\n- name: Add MIT License Headers\n  uses: Coderrob/add-copyright@v1\n  with:\n    name: \"John Doe\"\n    license: \"MIT\"\n```\n\n### Company-wide License Application\n\n```yaml\n- name: Add Apache 2.0 License to All Source Files\n  uses: Coderrob/add-copyright@v1\n  with:\n    name: \"Acme Corporation\"\n    license: \"Apache-2.0\"\n    working-directory: \".\"\n```\n\n### Multiple Directories\n\n```yaml\n- name: Add License to Frontend Code\n  uses: Coderrob/add-copyright@v1\n  with:\n    name: \"My Project\"\n    license: \"GPL-3.0-only\"\n    working-directory: \"frontend\"\n\n- name: Add License to Backend Code\n  uses: Coderrob/add-copyright@v1\n  with:\n    name: \"My Project\"\n    license: \"GPL-3.0-only\"\n    working-directory: \"backend\"\n```\n\n### Using with Matrix Strategy\n\n```yaml\njobs:\n  license:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        include:\n          - dir: \"src\"\n            license: \"MIT\"\n          - dir: \"tests\"\n            license: \"MIT\"\n    steps:\n      - uses: actions/checkout@v4\n      - name: Add Copyright\n        uses: Coderrob/add-copyright@v1\n        with:\n          name: \"My Organization\"\n          license: ${{ matrix.license }}\n          working-directory: ${{ matrix.dir }}\n```\n\n## 🔄 License Updates\n\nThis action automatically keeps its license database up-to-date by fetching the latest license texts from the [SPDX License List Data](https://github.com/spdx/license-list-data) repository. The update process runs monthly via a scheduled GitHub workflow.\n\n### Manual License Update\n\nTo manually trigger a license update:\n\n1. Go to the Actions tab in your repository\n2. Select \"Update Licenses\" workflow\n3. Click \"Run workflow\"\n\nOr execute the update script locally:\n\n```bash\n./scripts/update_licenses.sh\n```\n\n## 🛠️ Local Development\n\n### Prerequisites\n\n- Bash shell\n- Git\n- jq (JSON processor)\n- Standard Unix tools (sed, awk, find)\n\n### Running Locally\n\n```bash\n# Clone the repository\ngit clone https://github.com/Coderrob/add-copyright.git\ncd add-copyright\n\n# Update license database\n./scripts/update_licenses.sh\n\n# Add copyright to files\n./scripts/copyright.sh /path/to/your/project MIT \"Your Name\"\n```\n\n### Available Scripts\n\nThis project includes several utility scripts:\n\n#### `scripts/copyright.sh`\n\nThe main script that adds copyright headers to source files.\n\n```bash\n./scripts/copyright.sh \u003cdirectory\u003e \u003clicense-type\u003e \u003ccopyright-title\u003e\n```\n\n**Arguments:**\n\n- `directory`: Directory to scan for source files\n- `license-type`: SPDX license identifier (e.g., MIT, Apache-2.0)\n- `copyright-title`: Name of the copyright holder\n\n#### `scripts/update_licenses.sh`\n\nUpdates the local license database from the SPDX License List Data repository.\n\n```bash\n./scripts/update_licenses.sh\n```\n\n#### `scripts/release.sh`\n\nManages the release process, including creating semantic version tags and release branches.\n\n```bash\n./scripts/release.sh\n```\n\n### Testing\n\n```bash\n# Run the test suite\n./scripts/run_tests.sh\n\n# Test specific functionality\n./__tests__/test_copyright.sh\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n1. Fork the repository\n2. Clone your fork: `git clone https://github.com/your-username/add-copyright.git`\n3. Make your changes\n4. Run tests: `./scripts/run_tests.sh`\n5. Submit a pull request\n\n### Adding Support for New Languages\n\nTo add support for a new programming language:\n\n1. Add the file extension and comment style to `COMMENT_STYLES` array in `scripts/copyright.sh`\n2. Test with sample files\n3. Update this README with the new language\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n#### \"jq command not found\"\n\n```bash\n# Install jq\n# macOS\nbrew install jq\n# Ubuntu/Debian\nsudo apt-get install jq\n# CentOS/RHEL\nsudo yum install jq\n```\n\n#### \"License file not found\"\n\n- Ensure the license identifier is a valid SPDX identifier\n- Check the [SPDX License List](https://spdx.org/licenses/) for valid identifiers\n- The license database is updated monthly; try running the update script\n\n#### \"Permission denied\"\n\n```bash\n# Make scripts executable\nchmod +x scripts/*.sh\n```\n\n#### \"Files not being processed\"\n\n- Check if files are in `.gitignore`\n- Verify file extensions are supported\n- Ensure files don't already contain current copyright notices\n\n### Debug Mode\n\nEnable debug logging by setting the `DEBUG` environment variable:\n\n```bash\nDEBUG=1 ./scripts/copyright.sh /path/to/project MIT \"Your Name\"\n```\n\n## 🙏 Acknowledgments\n\n- [SPDX License List Data](https://github.com/spdx/license-list-data) for license information\n- [GitHub Actions](https://github.com/features/actions) for the CI/CD platform\n- Community contributors for their valuable input\n\n---\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n\n## Ownership\n\nThis repository is maintained by **Rob \"Coderrob\" Lindley**. For inquiries, please contact via GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderrob%2Fadd-copyright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderrob%2Fadd-copyright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderrob%2Fadd-copyright/lists"}