Skip to content

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

Merged
joehan merged 4 commits intomasterfrom
aalej-func-setup
Apr 30, 2024
Merged

Adds *.local to .gitignore and functions ignore for functions setup#7018
joehan merged 4 commits intomasterfrom
aalej-func-setup

Conversation

@aalej
Copy link
Copy Markdown
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 requested review from blidd-google and inlined April 22, 2024 04:30
@joehan joehan enabled auto-merge (squash) April 30, 2024 04:42
@joehan joehan merged commit d265a15 into master Apr 30, 2024
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 <joehanley@google.com>
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 <joehanley@google.com>
@aalej aalej deleted the aalej-func-setup branch March 25, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants