Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds *.local to .gitignore and functions ignore for functions setup #7018

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

aalej
Copy link
Contributor

@aalej aalej commented Apr 18, 2024

Description

Fixes #7017

Add *.local to the functions.ignore list in firebase.json file and the .gitignore by default to avoid accidentally leaking secret values

Scenarios Tested

firebase init functions --project PROJECT_ID

  • Functions setup makes the ff based on what language is picked

JavaScript

functions/.gitignore

node_modules/
*.local

firebase.json

{
  "functions": [
    {
      "source": "functions",
      "codebase": "default",
      "ignore": [
        "node_modules",
        ".git",
        "firebase-debug.log",
        "firebase-debug.*.log",
        "*.local"
      ]
    }
  ]
}

TypeScript

functions/.gitignore

# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map

# TypeScript v1 declaration files
typings/

# Node.js dependency directory
node_modules/
*.local

firebase.json

{
  "functions": [
    {
      "source": "functions",
      "codebase": "default",
      "ignore": [
        "node_modules",
        ".git",
        "firebase-debug.log",
        "firebase-debug.*.log",
        "*.local"
      ],
      "predeploy": [
        "npm --prefix \"$RESOURCE_DIR\" run lint",
        "npm --prefix \"$RESOURCE_DIR\" run build"
      ]
    }
  ]
}

Python

functions/.gitignore

*.local

firebase.json

{
  "functions": [
    {
      "source": "functions",
      "codebase": "default",
      "ignore": [
        "venv",
        ".git",
        "firebase-debug.log",
        "firebase-debug.*.log",
        "*.local"
      ]
    }
  ]
}

Sample Commands

firebase init functions

@joehan joehan enabled auto-merge (squash) April 30, 2024 04:42
@joehan joehan merged commit d265a15 into master Apr 30, 2024
35 checks passed
blidd-google pushed a commit that referenced this pull request May 1, 2024
…7018)

* Adds *.local to .gitignore and functions ignore for javascript,typescript, and python templates

* Added changelog entry

---------

Co-authored-by: joehan <[email protected]>
mathu97 pushed a commit that referenced this pull request May 6, 2024
…7018)

* Adds *.local to .gitignore and functions ignore for javascript,typescript, and python templates

* Added changelog entry

---------

Co-authored-by: joehan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firebase deployment uploads .secret.local
3 participants