Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a059f60

Browse files
committed
🔄 synced local '.github/workflows/module-packager.yml' with remote '.github/workflows/module-packager.yml'
1 parent 552317a commit a059f60

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

‎.github/workflows/module-packager.yml‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
# REPO: Your repo path (org/repo)
1515
# MODULE_NAME: Module folder and file prefix (e.g. mod_example)
1616
# MODULE_XML: Main XML file (e.g. mod_example.xml)
17+
# If blank, MODULE_NAME and MODULE_XML will be set automatically below
1718
# COPYRIGHT_HOLDER: Copyright string (e.g. YourName (YourHandle))
1819
# COPYRIGHT_START_YEAR: Copyright start year (e.g. 2025)
1920
# PHP_VERSION: PHP version to use (e.g. 8.1)
@@ -32,9 +33,9 @@ on:
3233
# =============================
3334
env:
3435
AUTHOR: "N6REJ"
35-
REPO: "N6REJ/mod_bears_aichatbot"
36-
MODULE_NAME: "mod_bears_aichatbot"
37-
MODULE_XML: "mod_bears_aichatbot.xml"
36+
REPO: ${{ github.repository }}
37+
MODULE_NAME: ""
38+
MODULE_XML: ""
3839
COPYRIGHT_HOLDER: "BearLeeAble (N6REJ)"
3940
COPYRIGHT_START_YEAR: "2025"
4041
PHP_VERSION: "8.1"
@@ -45,7 +46,7 @@ env:
4546
FAVICON_FILE: "favicon.ico"
4647
UPDATES_XML_FILE: "updates.xml"
4748
CSS_DIR: "css"
48-
JS_DIR: "js"
49+
JS_DIR: ""
4950
TMPL_DIR: "tmpl"
5051
LANGUAGE_DIR: "language"
5152
PACKAGE_DIR: "package"
@@ -58,6 +59,20 @@ jobs:
5859
contents: write
5960
pull-requests: write
6061
steps:
62+
- name: Set dynamic module variables
63+
run: |
64+
if [ -z "${{ env.MODULE_NAME }}" ]; then
65+
MODULE_NAME="${GITHUB_REPOSITORY##*/}"
66+
else
67+
MODULE_NAME="${{ env.MODULE_NAME }}"
68+
fi
69+
if [ -z "${{ env.MODULE_XML }}" ]; then
70+
MODULE_XML="${MODULE_NAME}.xml"
71+
else
72+
MODULE_XML="${{ env.MODULE_XML }}"
73+
fi
74+
echo "MODULE_NAME=$MODULE_NAME" >> $GITHUB_ENV
75+
echo "MODULE_XML=$MODULE_XML" >> $GITHUB_ENV
6176
- name: Determine workflow context
6277
id: context
6378
run: |

0 commit comments

Comments
 (0)