diff --git a/CHANGELOG.md b/CHANGELOG.md index b74a58f..2bc3b32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.1 - 11/15/2024 +* Added `EXCLUDE` parameter +* Fixed typo in `SLUG` to `ITEM_SLUG` + ## 2.0 - 06/11/2020 * Migrated To `varunsridharan/actions-alpine-php:latest` Docker Image * Improved Logging @@ -13,4 +17,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * Improved Logging ## 1.0 - 24/08/2019 -### First Release \ No newline at end of file +### First Release diff --git a/README.md b/README.md index a04b1cd..9288c14 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This Action Generates POT Files for your wordpress Plugin / Theme based on the c | `DOMAIN` | NULL | WordPress Theme / Plugin ***TextDomain*** | | `PACKAGE_NAME` | NULL | WordPress Theme / Plugin Name | | `HEADERS` | NULL | Array in JSON format of custom headers which will be added to the POT file. Defaults to empty array. | +| `EXCLUDE` | NULL | Comma separated list of paths to be excluded from the POT file. | | `GITHUB_TOKEN` | **secret** | you do not need to generate one but you do have to explicitly make it available to the Action | > **āš ļø Note:** You Should Provide Github Token. If Not Updated File Will Be Committed & Pushed. @@ -106,4 +107,4 @@ If you, or your company, use any of my projects or like what Iā€™m doing, kindly --- - \ No newline at end of file + diff --git a/action.yml b/action.yml index 23f7e5e..1f939ce 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,9 @@ inputs: headers: description: 'Array in JSON format of custom headers which will be added to the POT file. Defaults to empty array.' required: false + exclude: + description: 'Comma separated list of custom paths to exclude from the POT file.' + required: false runs: using: 'docker' @@ -33,3 +36,4 @@ runs: - ${{ inputs.domain }} - ${{ inputs.package_name }} - ${{ inputs.headers }} + - ${{ inputs.exclude }} diff --git a/entrypoint.sh b/entrypoint.sh index 449cfe9..0c6337d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,6 +12,7 @@ ITEM_SLUG="$(gh_input "ITEM_SLUG" "${GITHUB_REPOSITORY#*/}")" SAVE_PATH="$(gh_input "SAVE_PATH")" PACKAGE_NAME="$(gh_input "PACKAGE_NAME")" HEADERS="$(gh_input "HEADERS" "{}")" +EXCLUDE="$(gh_input "EXCLUDE")" DOMAIN="$(gh_input "DOMAIN" "${ITEM_SLUG}")" SAVE_FULL_PATH="$SAVE_PATH/$DOMAIN.pot" @@ -29,15 +30,16 @@ gh_log_group_end gh_log gh_log_group_start "šŸ“ Parsed Arguments" gh_log "DOMAIN : $DOMAIN" -gh_log "SLUG : $SLUG" +gh_log "SLUG : $ITEM_SLUG" gh_log "PACKAGE_NAME : $PACKAGE_NAME" gh_log "HEADERS : $HEADERS" +gh_log "EXCLUDE : $EXCLUDE" gh_log "SAVE_PATH : $SAVE_PATH/$DOMAIN.pot" gh_log_group_end gh_log gh_log_group_start "šŸ“ Generating POT File" -wp i18n make-pot . "$SAVE_FULL_PATH" --slug="$ITEM_SLUG" --package-name="$PACKAGE_NAME" --headers="$HEADERS" --domain="$DOMAIN" --allow-root +wp i18n make-pot . "$SAVE_FULL_PATH" --slug="$ITEM_SLUG" --package-name="$PACKAGE_NAME" --headers="$HEADERS" --exclude="$EXCLUDE" --domain="$DOMAIN" --allow-root gh_log_group_end gh_log