Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

"branch" in .deploy({ branch }) accepts upper case letters and symbols, but deployment is "Not Found" #138

Open
nwtgck opened this issue Aug 21, 2020 · 0 comments

Comments

@nwtgck
Copy link

nwtgck commented Aug 21, 2020

- What is the current behavior?

When I deployed with branch: which includes upper cases or symbols, deployment is done successfully. But, deployed URL, .deploy.deploy_ssl_ur tells me "Not Found".

const NetlifyAPI = require('netlify');

const token = process.env.NETLIFY_AUTH_TOKEN;
const siteId = process.env.NETLIFY_SITE_ID;

const client = new NetlifyAPI(token);

(async () => {
  const deploy = await client.deploy(siteId, './public', {
    draft: true,
    branch: 'UPPERCASE', // https://uppercase--nwtgck-netlify-test.netlify.app/
    // branch: 'slash/hoge', // https://slash-hoge--nwtgck-netlify-test.netlify.app/
    // branch: 'under_score', // https://under-score--nwtgck-netlify-test.netlify.app/

  });
  console.log('URL: ', deploy.deploy.deploy_ssl_url);
})();

- What is the expected behavior?

The internal API or this "js-client" converts "branch" property properly.

my workaround

branch = branch.replace(/[^a-zA-Z\d]/g, '-').toLowerCase()

related: nwtgck/actions-netlify#243

@nwtgck nwtgck changed the title "branch" in .deploy({ branch }) accpets upper case letters, symbols and so on, but they are invalid "branch" in .deploy({ branch }) accepts upper case letters and symbols, but deployment is "Not Found" Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant