Skip to content

Commit 1194268

Browse files
committed
Real path fix
1 parent d23b659 commit 1194268

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

action.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ runs:
2323
steps:
2424
- name: Setting env variables...
2525
run: |
26-
echo "GENERATOR_TMP_FILES_PATH=${{ runner.temp }}/phpdocs-${{ github.sha }}-${{ github.run_id }}-${{ github.github.run_attempt }}" >> $GITHUB_ENV
26+
GENERATOR_DOCS_PATH=$(php ${{ github.action_path }}/bin/realpath.php "${{ inputs.output_path }}")
27+
GENERATOR_TMP_FILES_PATH="${{ runner.temp }}/phpdocs-${{ github.sha }}-${{ github.run_id }}-${{ github.github.run_attempt }}"
28+
29+
echo "GENERATOR_TMP_FILES_PATH=$GENERATOR_TMP_FILES_PATH" >> $GITHUB_ENV
30+
echo "GENERATOR_DOCS_PATH=$GENERATOR_DOCS_PATH" >> $GITHUB_ENV
2731
shell: bash
2832

29-
- name: Creating tmp folders...
33+
- name: Creating needed folders...
3034
run: |
3135
rm -rf ${{ env.GENERATOR_TMP_FILES_PATH }} || true
3236
mkdir -p ${{ env.GENERATOR_TMP_FILES_PATH }}
37+
mkdir -p "${{ inputs.output_path }}" || true
3338
shell: bash
3439

3540
- name: Running phpDocumentator...
@@ -41,7 +46,7 @@ runs:
4146
shell: bash
4247

4348
- name: Generating documentation...
44-
run: composer global exec phpdocmd ${{ env.GENERATOR_TMP_FILES_PATH }}/structure.xml ${{ inputs.output_path }}
49+
run: composer global exec phpdocmd "$GENERATOR_TMP_FILES_PATH/structure.xml" "$GENERATOR_DOCS_PATH"
4550
shell: bash
4651

4752
- name: Uninstalling evert/phpdoc-md...
@@ -50,5 +55,5 @@ runs:
5055

5156
- name: Deleting tmp data...
5257
run: |
53-
rm -rf ${{ env.GENERATOR_TMP_FILES_PATH }} || true
58+
rm -rf "$GENERATOR_TMP_FILES_PATH" || true
5459
shell: bash

bin/phpdoc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
IGNORED_FILES=$1
44
PHPDOC_TAG=$2
55

6-
GENERATOR_DOCKER_APP_ARGS="--target=/result --directory=/data --cache-folder=/tmp -v --template=xml --ansi --no-interaction"
6+
GENERATOR_DOCKER_APP_ARGS="--target=/result --directory=/data --cache-folder=/tmp -v --template=xml --ansi --no-interaction --ignore=\"vendor/**\""
77
if [ "$IGNORED_FILES" != "" ]; then
88
while read -r line
99
do

bin/realpath.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
if (!isset($argv[1])) {
4+
echo 'ERROR: first argument is missing';
5+
exit(1);
6+
}
7+
8+
echo realpath($argv[1]);

0 commit comments

Comments
 (0)