{"id":20533115,"url":"https://github.com/minituff/add-header-action","last_synced_at":"2025-06-30T08:33:30.042Z","repository":{"id":208493795,"uuid":"719206221","full_name":"Minituff/add-header-action","owner":"Minituff","description":"Add a header to any file within you repo.","archived":false,"fork":false,"pushed_at":"2025-06-21T14:42:27.000Z","size":218,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T02:46:58.456Z","etag":null,"topics":["actions","docker","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Minituff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["minituff"]}},"created_at":"2023-11-15T17:20:20.000Z","updated_at":"2025-06-21T14:42:19.000Z","dependencies_parsed_at":"2024-04-26T03:27:57.595Z","dependency_job_id":"29bf4fa0-37da-44ba-80df-838a7f2399cf","html_url":"https://github.com/Minituff/add-header-action","commit_stats":null,"previous_names":["minituff/add-header-action"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Minituff/add-header-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minituff%2Fadd-header-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minituff%2Fadd-header-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minituff%2Fadd-header-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minituff%2Fadd-header-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Minituff","download_url":"https://codeload.github.com/Minituff/add-header-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minituff%2Fadd-header-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262739294,"owners_count":23356700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actions","docker","python"],"created_at":"2024-11-16T00:18:50.029Z","updated_at":"2025-06-30T08:33:30.017Z","avatar_url":"https://github.com/Minituff.png","language":"Python","funding_links":["https://github.com/sponsors/minituff"],"categories":[],"sub_categories":[],"readme":"\u003c!-- SUPER SECRET CONFIDENTIAL --\u003e\n\u003c!-- [2023] - [Infinity and Beyond] ACME CO --\u003e\n\u003c!-- All Rights Reserved. --\u003e\n\u003c!-- NOTICE: This is super secret info that --\u003e\n\u003c!-- must be protected at all costs. --\u003e\n\n# Add header-action\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-active-undefined.svg?logo=github\u0026logoColor=white\u0026style=flat)](https://github.com/marketplace/actions/add-header)\n[![CI Status](https://github.com/Minituff/add-header-action/actions/workflows/lint-and-test.yml/badge.svg)](https://github.com/Minituff/add-header-action/actions/workflows/lint-and-test.yml)\n[![codecov](https://codecov.io/github/Minituff/add-header-action/graph/badge.svg?token=NGVZKMXTM2)](https://codecov.io/github/Minituff/add-header-action)\n\nIntelligently add a header to any file within your repo.\n\n## Header examples\n\u003cdetails open\u003e\u003csummary\u003e------ Expand Me ------\u003c/summary\u003e\n\nThis action can support any `UTF-8` file type.\n\n**Bash**\n```bash\n#!/usr/bin/env bash\n\n# SUPER SECRET CONFIDENTIAL \n# [2023] - [Infinity and Beyond] ACME Inc \n# All Rights Reserved. \n\nhello-world() {\n    echo \"Hello world\"\n}\n```\n**Javascript**\n```js\n// SUPER SECRET CONFIDENTIAL \n// [2023] - [Infinity and Beyond] ACME Inc \n// All Rights Reserved. \n\nfunction helloWorld() {\n    console.log(\"Hello world\")\n}\n```\n\n**HTML**\n```html\n\u003c!DOCTYPE html\u003e\n\n\u003c!-- SUPER SECRET CONFIDENTIAL --\u003e\n\u003c!-- [2023] - [Infinity and Beyond] ACME Inc --\u003e\n\u003c!-- All Rights Reserved. --\u003e\n\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"\u003e\n    \u003clink rel=\"stylesheet\" href=\"style.css\" type=\"text/css\"\u003e\n\u003c/head\u003e\n```\n\nAnd many more.\n\u003c/details\u003e\n\n## Usage\nThis action is ready to go out of the box. To change the header, see the [Customization](#customization) section.\n\n\n```yml\nname: Add header\n\njobs:\n  build:\n    name: Add headers\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        token: ${{ secrets.PAT }} # (only needed for private repos)\n    \n    - name: Add header action step\n      uses: minituff/add-header-action@v1\n      with: # All arguments are optional, see the defaults below\n        dry-run: false # Don't make any changes, but log what *would* change.\n        verbose: false # Extra logging to help you debug.\n        file-name: .headerrc.yml # The name of your settings file.\n      env:\n        FORCE_COLOR: \"1\" # Optional: Shows color output in GitHub console.\n\n    - name: Commit and Push changes back to repo\n      uses: stefanzweifel/git-auto-commit-action@v5\n```\n## Customization\nCreate a `.headerrc.yml` file in either the `.github` **or** *root* diretory of your project.\n\n```console\n📦root\n ┣ 📂.github\n ┃ ┣ 📂workflows\n ┃ ┃ ┗ 📜add-header-workflow.yml\n ┃ ┗ 📜.headerrc.yml             # \u003c---- Either here\n ┗ 📜.gitignore\n\n📦root\n ┣ 📜.headerrc.yml               # \u003c---- Or here\n ┗ 📜.gitignore\n```\n\nThis action loads default values from the [headerrc-default.yml](/headerrc-default.yml) \u003csmall\u003e(this is built into the action)\u003c/small\u003e, then merges them with the values from the [.headerrc.yml](/.github/.headerrc.yml) file from your repo.\n\nThe following are a list of configurable options in the `.headerrc.yml`:\n\n```yaml\n# Choose what to do with the header.\n# remove  =  Remove an existing header from matching files.\n# add     =  Add the header to any matching files.\nheader_action: add # Default: add\n\n# Decide the method for choosing which files to add headers to.\n# opt-out  =  All files will be selected unless the file path matches untracked_files.\n# opt-in   =  No files will be selected unless the file path matches anything in tracked_files.\nfile_mode: opt-out # Default: opt-out\n\n# A list of regex used to match file paths to receive the header. (opt-in mode only)\ntracked_files: \n  - ^README.md$\n\n# A list of regex used to match file paths to be skipped. (opt-out mode only)\n# All file paths *not* matched will receive a header.\nuntracked_files:\n  - app/\n  - ^Dockerfile$\n\n# Automatically add everything in the .gitignore file into the untracked_files section.\n# This can save lots of time because most of these files can be ignored.  (opt-out mode only)\nuntrack_gitignore: true # Default: true\n\nuse_default_file_settings: true # Default: true\n\n# The header to be added. Do not add the comment (#, //) here, see the file_associations section for that.\nheader: |\n  SUPER SECRET CONFIDENTIAL\n\n  [2023] - [Infinity and Beyond] ACME Inc\n  All Rights Reserved.\n  \n  NOTICE: This is super secret info that\n  must be protected at all costs.\n\n# Customize the negation character. See below for how to use this.\n# Any *default* file assocation that has this character at the beginning of the (key/value) will be removed. This only works if it is matched exactly. \nnegate_characters: \"!\" # Default: \"!\"\n\n# Group mulitple items by the comment value.\nfile_associations_by_comment:\n  \"#\": \n    - \"^.gitignore$\"\n    - \"!^.gitignore$\" # \u003c-- Negate default items like this\n    - \".gitignore$\" # \u003c---- You can also re-add any negated items\n  \"//\": \n    - \".js$\"\n    - \".ts$\"\n\n# The item extension and the assocated comment. Overrides file_associations_by_comment if duplicates.\n# Remember the escape charter for yml is \"\\\"\n# Here, you can only negate items by their key\nfile_associations_by_extension:\n  \".*\\.ya?ml$\": \"#\"\n  \"!.md\": [\"\u003c!--\", \"--\u003e\"] # \u003c--- Negate default items like this\n\n# For files that have 'important' first lines (like bash), use this setting to move the header below that line.\n# Here, you can only negate items by their key.\nskip_lines_that_have:\n  \".sh$\": [\"#!\"]\n```\n\n## Understanding Negation\nThis action comes pre-loaded with many common files types in the [headerrc-default.yml](/headerrc-default.yml).\nHowever, some of these file types may be incorrect for your project. To fix this, we allow *negation* of default items.\n\n\nTo negate something, the format is `\u003cnegate_characters\u003e\u003citem headerrc-default.yml\u003e`.\n\nFor example, we filter out the `.gitignore` in the [headerrc-default.yml](/headerrc-default.yml)\n```yml\nuntracked_files:\n  - ^\\.gitignore\n```\nBut if you would like to remove this item from the `untracked_files`. Simply add it to your `.headerrc.yml` with the `negation_characters` as the prefix.\nIt must match EXACTLY with is in the in the [headerrc-default.yml](/headerrc-default.yml).\n\n```yml\nuntracked_files:\n  - !^\\.gitignore  \u003c-- Negate ^\\.gitignore\n```\n\nYou can also change the negate_characters to be anything you'd like if the default clashes with your regex.\n```yml\nnegate_characters: \"++\" # Default \"!\"\n```\n\n### What can be negated?\n\n1. `tracked_files`\n1. `untracked_files`\n1. `file_associations_by_comment`\n1. `file_associations_by_extension`\n1. `skip_lines_that_have`\n\nNegation is an easy way to remove the default settings, but if we have a file association wrong, please submit an Issue or PR so we can fix it for everyone.\n\n\n## Default argumnet values\n\nIf your choose not to set any arguments in your GitHub workflows, they will take the following values:\n```yml\ndry-run: false \nverbose: false\nfile-name: .headerrc.yml # Located in either the `.github` or *root* diretory of your project.\n```\n\n## Developing \u0026 Contributing\nPull Requests are welcome. \nSee the [DevContainer folder](/.devcontainer/README.md) for more information\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminituff%2Fadd-header-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminituff%2Fadd-header-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminituff%2Fadd-header-action/lists"}