fix(action): implement potential fixes for 4 code quality findings from GitHub #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| paths: | |
| - package.json | |
| - action.js | |
| - .github/workflows/testrig.yml | |
| - action.yml | |
| - remote-loader/action.yml | |
| pull_request: | |
| paths: | |
| - package.json | |
| - action.js | |
| - action.yml | |
| - remote-loader/action.yml | |
| workflow_dispatch: | |
| env: | |
| RUNNER_DEBUG: "true" | |
| ACTIONS_STEP_DEBUG: "true" | |
| jobs: | |
| example-secrets: | |
| name: Load demo encrypted .env.ci file | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 24.x to mimic GHA prod environment | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: 24 | |
| - name: Install deps and test | |
| run: npm ci && npm run test | |
| id: dotenvx | |
| env: | |
| INPUT_KEY: ${{ secrets.DOTENV_PRIVATE_KEY_CI }} | |
| INPUT_INJECT_ENV_VARS: "true" | |
| INPUT_PATH: ".env.ci" | |
| - name: Check if everything's fine | |
| run: | | |
| echo 'Demo user: ${{ steps.dotenvx.outputs.DEMO_USER }}' | |
| echo 'Demo password (should be masked): ${{ steps.dotenvx.outputs.DEMO_PASS }}' | |
| echo 'Now touch ${{ steps.dotenvx.outputs.TOUCH }} (also blurred too)' | |
| - name: Check variables | |
| run: | | |
| printenv | grep DOTENV | |
| remote-loader: | |
| name: Test remote loader action | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Try loading from remote | |
| uses: andreijiroh-dev/dotenvx-action/remote-loader@main | |
| id: dotenvx | |
| with: | |
| url: https://raw.githubusercontent.com/andreijiroh-dev/dotenvx-action/main/.env.ci | |
| key: ${{ secrets.DOTENV_PRIVATE_KEY_CI }} | |
| inject-env-vars: "true" | |
| - name: Check if everything's fine | |
| run: | | |
| echo 'Demo user: ${{ fromJson(steps.dotenvx.outputs.DOTENV_RESULT).DEMO_USER }}' | |
| echo 'Demo password (should be masked): ${{ fromJson(steps.dotenvx.outputs.DOTENV_RESULT).DEMO_PASS }}' | |
| echo 'Now touch ${{ fromJson(steps.dotenvx.outputs.DOTENV_RESULT).TOUCH }} (also blurred too)' |