Skip to content

Commit

Permalink
Merge pull request #63 from threadi/feature/addGitHubActionToUpdateHo…
Browse files Browse the repository at this point in the history
…okDocu

add GitHub action to update hook docu
  • Loading branch information
threadi authored Dec 15, 2024
2 parents 8807ce0 + 19d190f commit 80b681b
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 50 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,14 @@ jobs:
cd ../../../
- name: Generate autoloader
run: composer dump-autoload -oa
run: composer dump-autoload -oa --no-dev

- name: Run WordPress Coding Standard fixes
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/svn/* --standard=ruleset.xml .

- name: Run WordPress Coding Standard checks
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/svn/* --standard=ruleset.xml .

- name: Generate hook documentation
run: vendor/bin/wp-documentor parse app --format=markdown --output=docs/hooks.md --prefix=eml_

- name: Generate autoloader
run: composer dump-autoload -oa --no-dev

- name: Set version number 1
uses: richardrigutins/replace-in-files@v2
with:
Expand All @@ -64,7 +58,7 @@ jobs:
rm readme.md
rm ruleset.xml
cd ..
zip -r -q ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/* -x "*/.git/*" "*/.github/*" "*/blocks/*/src/*" "*/doc/*" "*/legacy-classes/Divi/.yarn/*" "*/phpcs.xml" "*/composer.json" "*/composer.lock" "*/package.json" "*/package-lock.json" "*/ruleset.xml" "*/.gitignore" "*/vendor/*" "*/node_modules/*" "/.editorconfig"
zip -r -q ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/* -x "*/.git/*" "*/.github/*" "*/blocks/*/src/*" "*/docs/*" "*/phpcs.xml" "*/composer.json" "*/composer.lock" "*/package.json" "*/package-lock.json" "*/ruleset.xml" "*/.gitignore" "*/vendor/*" "*/node_modules/*" "/.editorconfig"
zip -ur ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/vendor/autoload.php
zip -ur ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/vendor/composer/*
zip -ur ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/vendor/threadi/*/build/*
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/update-hook-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update Hook documentation

on:
workflow_dispatch:

jobs:
build:
name: Build release zip
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run package installs and builds
run: |
composer install
composer update
- name: Generate hooks documentation file
run: vendor/bin/wp-documentor parse app --format=markdown --output=docs/hooks.md --prefix=eml_

- name: Update resources
uses: test-room-7/action-update-file@v1
with:
file-path: docs/hooks.md
commit-msg: Update resources
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion admin/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ body.settings_page_eml_settings .dashicons-yes { color: green }

.settings_page_eml_settings #state { width: 80px }

.settings_page_eml_settings #date { width: 120px }
.settings_page_eml_settings #date { width: 210px }

.settings_page_eml_settings .eml-log-table #url { width: 320px }

Expand Down
2 changes: 1 addition & 1 deletion app/ExternalFiles/Forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ private function get_fields( bool $single = false ): array {
$fields[] = '<label for="external_files">' . esc_html__( 'Enter one URL per line for external files you want to insert in your library', 'external-files-in-media-library' ) . ' <a href="' . esc_url( Helper::get_support_url_for_urls() ) . '" target="_blank"><span class="dashicons dashicons-editor-help"></span></a></label><textarea id="external_files" name="external_files" class="eml_add_external_files" placeholder="https://example.com/file.pdf"></textarea>';

// add credentials fields.
$fields[] = '<details><summary>' . __( 'Add credentials to access these URLs', 'external-files-in-media-library' ) . '</summary><div><label for="eml_use_credentials"><input type="checkbox" name="eml_use_credentials" value="1" id="eml_use_credentials"> ' . esc_html__( 'Use below credentials to import these URLs', 'external-files-in-media-library' ) . '</label></div><div><label for="eml_login">' . __( 'Login', 'external-files-in-media-library' ) . ':</label><input type="text" id="eml_login" name="text" value="" autocomplete="off"></div><div><label for="eml_password">' . __( 'Password', 'external-files-in-media-library' ) . ':</label><input type="password" id="eml_password" name="text" value="" autocomplete="off"></div><p><strong>' . __( 'Hint:', 'external-files-in-media-library' ) . '</strong> ' . __( 'files with credentials will be saved locally.', 'external-files-in-media-library' ) . '</p></details>';
$fields[] = '<details><summary>' . __( 'Add credentials to access these URLs', 'external-files-in-media-library' ) . '</summary><div><label for="eml_use_credentials"><input type="checkbox" name="eml_use_credentials" value="1" id="eml_use_credentials"> ' . esc_html__( 'Use below credentials to import these URLs', 'external-files-in-media-library' ) . '</label></div><div><label for="eml_login">' . __( 'Login', 'external-files-in-media-library' ) . ':</label><input type="text" id="eml_login" name="text" value="" autocomplete="off"></div><div><label for="eml_password">' . __( 'Password', 'external-files-in-media-library' ) . ':</label><input type="password" id="eml_password" name="text" value="" autocomplete="off"></div><p><strong>' . __( 'Hint:', 'external-files-in-media-library' ) . '</strong> ' . __( 'Files with credentials will be saved locally.', 'external-files-in-media-library' ) . '</p></details>';

/**
* Filter the fields for the dialog. Additional fields must be marked with "eml-use-for-import" as class.
Expand Down
Loading

0 comments on commit 80b681b

Please sign in to comment.