Skip to content

Commit ef0e26d

Browse files
authored
fix: workflow input parsing (#173)
1 parent 043ea62 commit ef0e26d

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.github/workflows/code-standards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171
- name: Run PHP CS Fixer
7272
run: |
7373
# set environment variables in script
74-
export RULES=$(echo $'${INPUTS_RULES} ${INPUTS_ADD_RULES}'|tr -d '\n\t\r '|jq -s '.[0] * .[1]' -crM)
75-
export EXCLUDE_PATTERNS=$(echo $'${INPUTS_EXCLUDE_PATTERNS}'|tr -d '\n\t\r ')
74+
export RULES=$(echo ${INPUTS_RULES} ${INPUTS_ADD_RULES}|tr -d '\n\t\r '|jq -s '.[0] * .[1]' -crM)
75+
export EXCLUDE_PATTERNS=$(echo ${INPUTS_EXCLUDE_PATTERNS}|tr -d '\n\t\r ')
7676
7777
# use config path only if EXCLUDE_PATTERN is empty
7878
CMD_PATH=$([ "$EXCLUDE_PATTERNS" = "" ] && echo "$CONFIG_PATH" || echo "")

.github/workflows/doctum.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ jobs:
5252
use Doctum\Version\GitVersionCollection;
5353
use Symfony\Component\Finder\Finder;
5454
55-
$defaultVersion = '${INPUTS_DEFAULT_VERSION}';
56-
$tagPattern = '${INPUTS_TAG_PATTERN}';
55+
$defaultVersion = getenv('INPUTS_DEFAULT_VERSION');
56+
$tagPattern = getenv('INPUTS_TAG_PATTERN');
5757
5858
$iterator = Finder::create()
5959
->files()
6060
->name('*.php')
61-
->notName('${INPUTS_EXCLUDE_FILE}')
61+
->notName(getenv('INPUTS_EXCLUDE_FILE'))
6262
->exclude('GPBMetadata')
6363
->in(__DIR__ . '/src');
6464
@@ -71,8 +71,8 @@ jobs:
7171
}
7272
7373
return new Doctum($iterator, [
74-
'title' => '${INPUTS_TITLE}',
75-
'theme' => '${INPUTS_THEME}',
74+
'title' => getenv('INPUTS_TITLE'),
75+
'theme' => getenv('INPUTS_THEME'),
7676
'versions' => $versions,
7777
'build_dir' => __DIR__ . '/.build/%version%',
7878
'cache_dir' => __DIR__ . '/.cache/%version%',
@@ -84,19 +84,19 @@ jobs:
8484
)
8585
echo "$DOCTUM_CONFIG"; # for debugging
8686
echo "$DOCTUM_CONFIG" > doctum-config.php;
87-
env:
88-
INPUTS_DEFAULT_VERSION: ${{ inputs.default_version }}
89-
INPUTS_TAG_PATTERN: ${{ inputs.tag_pattern }}
90-
INPUTS_EXCLUDE_FILE: ${{ inputs.exclude_file }}
91-
INPUTS_TITLE: ${{ inputs.title }}
92-
INPUTS_THEME: ${{ inputs.theme }}
9387
- name: Run Doctum to Generate Documentation
9488
run: |
9589
php doctum.phar update doctum-config.php --ignore-parse-errors
9690
if [ ! -d .build ]; then
9791
echo "Action did not generate any documentation. Did you forget to provide a default_version or tag_pattern?";
9892
exit 1;
9993
fi
94+
env:
95+
INPUTS_DEFAULT_VERSION: ${{ inputs.default_version }}
96+
INPUTS_TAG_PATTERN: ${{ inputs.tag_pattern }}
97+
INPUTS_EXCLUDE_FILE: ${{ inputs.exclude_file }}
98+
INPUTS_TITLE: ${{ inputs.title }}
99+
INPUTS_THEME: ${{ inputs.theme }}
100100
- if: inputs.default_version
101101
name: Redirect Index to Latest Version
102102
run: |

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,10 @@
4646
"google/cloud-dlp": "^1.10",
4747
"google/cloud-storage": "^1.33",
4848
"google/cloud-secret-manager": "^1.12"
49+
},
50+
"config": {
51+
"audit": {
52+
"block-insecure": false
53+
}
4954
}
5055
}

0 commit comments

Comments
 (0)