'Do I need to pass each secret to my GitHub Actions workflow file?

I have a number of secrets, stored in Settings/Secrets/Action of my repo.

image of github settings page with action secrets

The various secrets are used by my application but none of them are used in the command.

name: BuildCheck

on:
  push:
  pull_request:
    branches: [main]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - run: npm ci
      - run: npm run build

Do I need to add all the variables under env top level map in the config file above in order for the action to use them?

This seems to break my automated flow of managing secrets with Doppler.

Is there a way to inject all secrets, without explicitly specifying them? (I did look at the docs but failed to find if this is possible)

Coming from Vercel, which does this it feels like a bit of a step back.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source