简体   繁体   中英

GitHub Actions - *some* empty env secrets

We have a specific branch in a specific repository that doesn't get all the secrets in the workflow action.

Ie, some of the secrets seem empty even though they are all defined as organization secrets available to all repositories within the organization.

所有这些环境。 vars 直接派生自秘密 ${{ secrets.XXX }}

As you can see in the screenshot, some were empty and some not. Despite all of them being set the same.

I even tried setting those secrets on the specific repo but still they are empty.

*** EDIT ***

Here is the relevant part of the workflow file:

on:
  push:
    branches: [ master ]

  workflow_dispatch:

jobs:
  build:
    name: build
    runs-on: ubuntu-latest
    env:
      REACT_APP_AWS_REGION:               ${{ secrets.REGION }}
      REACT_APP_AWS_ACCESS_KEY_ID:        ${{ secrets.KEY_ID }}
      REACT_APP_AWS_SECRET_ACCESS_KEY:    ${{ secrets.SECRET }}
      REACT_APP_AWS_BUCKET:               ${{ secrets.BUCKET }}
      REACT_APP_COGNITO_REGION:           ${{ secrets.REGION }}
    steps:
      - uses: actions/checkout@v2
      - uses: c-hive/gha-yarn-cache@v1
      - run: yarn install
      - run: yarn run build
      - uses: actions/upload-artifact@v2
        with:
          name: build
          path: build/

It turns out that it was all because of a limit on the number of secrets on GitHub. Apparently, only the first 100 organization secrets are carried over to the repositories, so some of the environment variables which were based on the last (alphabetically-ordered) secrets became empty.

To overcome the issue temporarily I deleted some unused secrets to get below 100 organization secrets, and the deploy works normally again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM