This action replaces values preceded by SECRET_ in a given file. This is useful for replacing github secrets in an .env file.
Required The .env (or other) file where some values begin with SECRET_
Required A JSON object containing the keys (without the SECRET_ prefix) and values that should be replaced if found within the file.
- name: Replace secrets in .env uses: codeurs/secrets-replace@v2 with: file: "path1/to/.env" secrets: ${{ toJson(secrets) }}