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

NETLIFY_SITE_ID secret issue in monorepos #7

Closed
suancarloj opened this issue Feb 5, 2019 · 2 comments
Closed

NETLIFY_SITE_ID secret issue in monorepos #7

suancarloj opened this issue Feb 5, 2019 · 2 comments

Comments

@suancarloj
Copy link

suancarloj commented Feb 5, 2019

Hello,

I just noticed that when I tried to build a monorepo workflow I could not set two different NETLIFY_SITE_ID secret, how was it handle in this video https://vimeo.com/295659187 ?
I'm tempted to use a simple env var but I don't know what the risk is of saving the netlify site id in the git repo.

workflow "Build and deploy frontend on push" {
  on = "push"
  resolves = ["Publish app", "Publish admin"]
}

action "Check files app" {
  uses = "netlify/actions/diff-includes@master"
  args = "app"
}

// This will only be run if there are changes in docs directory in the last set
// of commits pushed
action "Publish app" {
  needs = "Check files app"
  uses = "netlify/actions/build@master"
  // see https://github.com/netlify/actions/tree/master/build for details
  secrets = ["GITHUB_TOKEN", "NETLIFY_SITE_ID"]
  env = {
    BUILD_DIR = "app"
  }
}

action "Check files admin" {
  uses = "netlify/actions/diff-includes@master"
  args = "admin"
}

// This will only be run if there are changes in docs directory in the last set
// of commits pushed
action "Publish admin" {
  needs = "Check files admin"
  uses = "netlify/actions/build@master"
  // see https://github.com/netlify/actions/tree/master/build for details
  secrets = ["GITHUB_TOKEN", "NETLIFY_SITE_ID"]
  env = {
    BUILD_DIR = "admin"
  }
}
@kitop
Copy link
Contributor

kitop commented Feb 6, 2019

Hi @suancarloj

The way secrets are handled changed since the demo (it's much better now!), but unfortunately that means the demo is no longer fully accurate.

You should be able to use env variables for NETLIFY_SITE_ID and store it in your repo, it's not unsafe at all. Just make sure to never expose any access token :)

@suancarloj
Copy link
Author

@kitop Awesome, exactly what I ended up doing, just wanted the confirmation :-D that it was safe! Thank you so much !

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

No branches or pull requests

2 participants