question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't publish by default on github builds

See original GitHub issue
  • Version: 22.9.1

When setting up a new github actions build, it attempts to publish the result automatically to github by default. I only noticed this because I received an unexpected error at the end of my build:

  ⨯ GitHub Personal Access Token is not set, neither programmatically, nor using env "GH_TOKEN"

This was a normal branch build, not tagged or anything, which I’d never normally want to publish.

This behaviour is pretty surprising, and in many cases it’s a serious security risk if you don’t expect it when there’s github token in the environment for some other reason. Build output even in open source repos could easily contain secrets, especially when you’re first setting up a new build - it would be easy for this to accidentally publish your code signing keys, for example.

Also, this surprising behaviour isn’t documented - there’s no default value for publish listed on the config value or CLI arguments.

There’s been quite a few issues discussing this in the past, all now closed due to inactivity, e.g. https://github.com/electron-userland/electron-builder/issues/4546 and https://github.com/electron-userland/electron-builder/issues/1693. I think it’s pretty clear that this is causing confusion.

Are you be open to disabling this? I think it’s just a matter of making null the default value for publish config (that’s the current workaround for this behaviour). I’d be happy to put a PR together for this, if you’re open to that.

In general, I’d personally prefer to have electron-builder publish as a separate action, so I can build that into my CI workflow in more complex ways (e.g. testing a built distributable before it’s published) but that’s a separate question, and being able to opt-in with --publish is fine for now.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:14
  • Comments:11

github_iconTop GitHub Comments

2reactions
pimterrycommented, Aug 23, 2021

This is still relevant, it has a fair few votes now, and AFAIK there’s nothing blocking it and it’s very easy to do (although it is a breaking change!). It would be great to hear thoughts from the maintainers on this issue.

0reactions
hovancikcommented, Aug 7, 2022

node_modules/.bin/electron-builder --linux snap -c.snap.publish=never is not working for me 😦

⨯ Cannot find module 'electron-publisher-never'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure CI/CD with GitHub Actions - Azure App Service
1. Define a service principal or publish profile. 2. Create a GitHub secret. Build, 1. Set up the environment. 2.
Read more >
Publish - electron-builder
electron-builder makes publishing dead simple. If GH_TOKEN or GITHUB_TOKEN is defined — defaults to [{provider: "github"}] . If KEYGEN_TOKEN is ...
Read more >
Publishing to GitHub Actions Marketplace - "you'll see a banner"
Actions are published to GitHub Marketplace immediately and aren't reviewed by GitHub ... but I still don't see any supposed banner appear.
Read more >
7 Github Actions Tricks I Wish I Knew Before I Started
For instance, you can build iOS apps even if you do not have a Mac (by using a MacOS machine with a manual...
Read more >
GitHub Pages - Quarto
There are three ways to publish Quarto websites and documents to GitHub Pages: ... published site using Jekyll (the GitHub default site generation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found