Skip to content

Commit

Permalink
Refactor env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dottxado committed Jan 27, 2025
1 parent 7e35d21 commit c5458fe
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/test-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ jobs:
env:
COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}'
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
GITHUB_USER_EMAIL: ${{ secrets.GITHUB_USER_EMAIL }}
GITHUB_USER_NAME: ${{ secrets.GITHUB_USER_NAME }}
GITHUB_USER_SSH_KEY: ${{ secrets.GITHUB_USER_SSH_KEY }}
PHP_CHECK: false
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -100,27 +98,33 @@ jobs:
.forEach(envVar => core.exportVariable(envVar.name, envVar.value));
- name: Set up SSH
if: ${{ env.GITHUB_USER_SSH_KEY != '' }}
if: ${{ secrets.GITHUB_USER_SSH_KEY != '' }}

Check failure on line 101 in .github/workflows/test-playwright.yml

View workflow job for this annotation

GitHub Actions / actionlint

context "secrets" is not allowed here. available contexts are "env", "github", "inputs", "job", "matrix", "needs", "runner", "steps", "strategy", "vars". see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ env.GITHUB_USER_SSH_KEY }}
ssh-private-key: ${{ secrets.GITHUB_USER_SSH_KEY }}

- name: Set up Git
if: ${{ env.GITHUB_USER_EMAIL != '' && env.GITHUB_USER_NAME != '' }}
if: ${{ secrets.GITHUB_USER_EMAIL != '' && secrets.GITHUB_USER_NAME != '' }}

Check failure on line 107 in .github/workflows/test-playwright.yml

View workflow job for this annotation

GitHub Actions / actionlint

context "secrets" is not allowed here. available contexts are "env", "github", "inputs", "job", "matrix", "needs", "runner", "steps", "strategy", "vars". see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details

Check failure on line 107 in .github/workflows/test-playwright.yml

View workflow job for this annotation

GitHub Actions / actionlint

context "secrets" is not allowed here. available contexts are "env", "github", "inputs", "job", "matrix", "needs", "runner", "steps", "strategy", "vars". see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details
run: |
git config --global user.email "${{ env.GITHUB_USER_EMAIL }}"
git config --global user.name "${{ env.GITHUB_USER_NAME }}"
git config --global user.email "${{ secrets.GITHUB_USER_EMAIL }}"
git config --global user.name "${{ secrets.GITHUB_USER_NAME }}"
- name: Check if PHP installation is needed
run: |
if [ "${{ hashFiles('composer.json') }}" != '' && "${{inputs.PHP_VERSION }}" != '' ]; then
echo "PHP_CHECK=true" >> $GITHUB_ENV
fi
- name: Set up PHP
if: ${{ hashFiles('composer.json') != '' && inputs.PHP_VERSION && inputs.PHP_VERSION != '' }} # move to env var
if: ${{ env.PHP_CHECK == 'true' }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.PHP_VERSION }}
tools: composer
coverage: none

- name: Install Composer dependencies
if: ${{ hashFiles('composer.json') != '' && inputs.PHP_VERSION && inputs.PHP_VERSION != '' }}
if: ${{ env.PHP_CHECK == 'true' }}
uses: ramsey/composer-install@v3
with:
composer-options: '--prefer-dist'
Expand Down

0 comments on commit c5458fe

Please sign in to comment.