Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed parameter typo, added 'exclude' parameter #4

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
### First Release
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -106,4 +107,4 @@ If you, or your company, use any of my projects or like what I’m doing, kindly
---


<!-- END common-footer.mustache -->
<!-- END common-footer.mustache -->
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -33,3 +36,4 @@ runs:
- ${{ inputs.domain }}
- ${{ inputs.package_name }}
- ${{ inputs.headers }}
- ${{ inputs.exclude }}
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand Down