Skip to content

Commit 32146c2

Browse files
committed
Replace more GitHub Actions expressions with environment variables.
1 parent 896fee1 commit 32146c2

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.github/workflows/install-testing.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ jobs:
116116
tools: ${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && 'wp-cli:2.4.0' || 'wp-cli' }}
117117

118118
- name: Download WordPress
119-
run: wp core download ${{ inputs.wp-version && format( '--version="{0}"', inputs.wp-version ) || '--version=nightly' }}
119+
run: |
120+
wp core download \
121+
${{ inputs.wp-version && '--version="${WP_VERSION}"' || '--version=nightly' }}
122+
env:
123+
WP_VERSION: ${{ inputs.wp-version }}
120124

121125
- name: Create wp-config.php file
122126
run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost="127.0.0.1:${DB_PORT}"

.github/workflows/reusable-end-to-end-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ jobs:
117117

118118
- name: Install Gutenberg
119119
if: ${{ inputs.install-gutenberg }}
120-
run: npm run env:cli -- plugin install gutenberg ${{ inputs.gutenberg-version && format( '--version="{0}"', inputs.gutenberg-version ) || '' }} --path="/var/www/${LOCAL_DIR}"
120+
run: |
121+
npm run env:cli -- plugin install gutenberg \
122+
${{ inputs.gutenberg-version && '--version="${GUTENBERG_VERSION}"' || '' }} \
123+
--path="/var/www/${LOCAL_DIR}"
124+
env:
125+
GUTENBERG_VERSION: ${{ inputs.gutenberg-version }}
121126

122127
- name: Install additional languages
123128
run: |

.github/workflows/slack-notifications.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,10 @@ jobs:
145145
- name: Prepare commit message.
146146
id: commit-message
147147
run: |
148-
COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g'
149-
${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }}
150-
EOF
151-
)
148+
COMMIT_MESSAGE="$(echo "${COMMIT_MSG_RAW}" | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g')"
152149
echo commit_message_escaped="${COMMIT_MESSAGE}" >> $GITHUB_OUTPUT
150+
env:
151+
COMMIT_MSG_RAW: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }}
153152

154153
- name: Construct payload and store as an output
155154
id: create-payload

0 commit comments

Comments
 (0)