Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
alyx | 7506090dd6 | ||
alyx | 988ba8ec1c | ||
meli-release-bot | 4107cb309d | ||
Geoffroy Empain | 1b91ee6c31 | ||
Geoffroy Empain | c616d2eb46 | ||
Geoffroy Empain | 0a12abda26 | ||
Geoffroy Empain | 091debe745 | ||
Geoffroy Empain | d1da01e743 | ||
semantic-release | 543f2ef0d3 | ||
semantic-release-bot | 1ea8332579 | ||
Geoffroy Empain | 2b3ea929c4 | ||
semantic-release | 71b346bcc4 | ||
semantic-release | 8365015a2e | ||
Geoffroy Empain | 0c3e85cbe1 | ||
Geoffroy Empain | 3ea2f6c0f8 | ||
Geoffroy Empain | 9c1193dcf4 |
|
@ -0,0 +1,11 @@
|
|||
<!--
|
||||
|
||||
Thanks for opening a PR on this repo 🎉 ! This is just a quick reminder of things we'd like you to check before submitting:
|
||||
- [ ] target your PR to branch `next`
|
||||
- [ ] if necessary, updates the [docs](https://github.com/getmeli/meli-docs)
|
||||
- [ ] use [semantic commits](https://www.conventionalcommits.org/en/v1.0.0)
|
||||
- [ ] read our [contributing guidelines](https://github.com/getmeli/meli/blob/beta/CONTRIBUTING.md)
|
||||
|
||||
Thanks a lot, and happy coding 🚀
|
||||
|
||||
-->
|
|
@ -1,8 +1,10 @@
|
|||
name: main
|
||||
on: [ push ]
|
||||
on: [ push, pull_request ]
|
||||
env:
|
||||
GITHUB_REPOSITORY_SSH_URL: "git@github.com:${{ github.repository }}.git"
|
||||
IS_RELEASE_BRANCH: "${{ github.ref == 'refs/heads/latest' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/beta' }}"
|
||||
GIT_AUTHOR_NAME: "meli-release-bot"
|
||||
GIT_COMMITTER_NAME: "meli-release-bot"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -22,7 +24,7 @@ jobs:
|
|||
echo "Next release version is $(cat VERSION)"
|
||||
env:
|
||||
RELEASE_DEPLOY_KEY: ${{ secrets.RELEASE_DEPLOY_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- name: "Lint"
|
||||
run: npm run lint
|
||||
|
@ -43,7 +45,7 @@ jobs:
|
|||
npx semantic-release -r $GITHUB_REPOSITORY_SSH_URL
|
||||
env:
|
||||
RELEASE_DEPLOY_KEY: ${{ secrets.RELEASE_DEPLOY_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- name: "realign next"
|
||||
if: ${{ env.IS_RELEASE_BRANCH == 'true' }}
|
||||
|
|
20
CHANGELOG.md
20
CHANGELOG.md
|
@ -1,3 +1,23 @@
|
|||
# [1.2.0](https://github.com/getmeli/meli-cli/compare/v1.1.2...v1.2.0) (2021-02-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* wrong logger namespace ([c616d2e](https://github.com/getmeli/meli-cli/commit/c616d2eb4661188b4d7926e7f96bb9937bdd5814))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* only warn repo undetected inside non-tty ([1b91ee6](https://github.com/getmeli/meli-cli/commit/1b91ee6c3176adf87c1dde6d875b42703e2a0d09))
|
||||
* update axios ([091debe](https://github.com/getmeli/meli-cli/commit/091debe74562c0a2b869098a37d84d8c3220a563))
|
||||
|
||||
## [1.1.2](https://github.com/getmeli/meli-cli/compare/v1.1.1...v1.1.2) (2020-12-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* cannot upload large sites ([2b3ea92](https://github.com/getmeli/meli-cli/commit/2b3ea929c4b0f315f058ed9885669aecbc7b22bf))
|
||||
|
||||
## [1.1.1](https://github.com/getmeli/meli-cli/compare/v1.1.0...v1.1.1) (2020-12-18)
|
||||
|
||||
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 Meli
|
||||
Copyright (c) 2021 Meli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@getmeli/cli",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -2206,9 +2206,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz",
|
||||
"integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==",
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.10.0"
|
||||
}
|
||||
|
@ -5025,9 +5025,9 @@
|
|||
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.13.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz",
|
||||
"integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA=="
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz",
|
||||
"integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg=="
|
||||
},
|
||||
"for-in": {
|
||||
"version": "1.0.2",
|
||||
|
|
10
package.json
10
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@getmeli/cli",
|
||||
"version": "1.1.1",
|
||||
"name": "@whatthegit/meli-cli",
|
||||
"version": "1.2.0",
|
||||
"description": "Meli CLI",
|
||||
"main": "build/index.js",
|
||||
"bin": {
|
||||
|
@ -22,9 +22,9 @@
|
|||
"lint:fix": "eslint ./src --ext .js,.jsx,.ts,.tsx --fix"
|
||||
},
|
||||
"author": "Charlie Bravo SRL",
|
||||
"license": "UNLICENSED",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.21.0",
|
||||
"axios": "^0.21.1",
|
||||
"chalk": "^4.1.0",
|
||||
"debug": "^4.2.0",
|
||||
"form-data": "^3.0.0",
|
||||
|
@ -53,7 +53,7 @@
|
|||
"eslint-plugin-security": "^1.4.0",
|
||||
"jest": "^26.6.3",
|
||||
"semantic-release": "^17.3.0",
|
||||
"semantic-release-license": "^1.0.0",
|
||||
"semantic-release-license": "^1.0.2",
|
||||
"terser-webpack-plugin": "^2.3.8",
|
||||
"ts-jest": "^25.5.1",
|
||||
"ts-loader": "^6.2.2",
|
||||
|
|
|
@ -6,53 +6,25 @@ import { Gitlab } from './gitlab';
|
|||
import { Gitea } from './gitea';
|
||||
import { UploadResponse } from '../upload-response';
|
||||
|
||||
const logger = new Logger('meli.server:setCommitStatus');
|
||||
const logger = new Logger('meli.cli:setCommitStatus');
|
||||
|
||||
export async function setCommitStatus(data: UploadResponse, release?: string): Promise<void> {
|
||||
const commitHash = getCommitHash();
|
||||
const repoId = getRepoId();
|
||||
|
||||
if (!repoId) {
|
||||
logger.warn('Repo id not detected, cannot set commit status');
|
||||
logger[process.stdout.isTTY ? 'debug' : 'warn']('Repo id not detected, cannot set commit status');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!commitHash) {
|
||||
logger.warn('Commit hash not detected, cannot set commit status');
|
||||
logger[process.stdout.isTTY ? 'debug' : 'warn']('Commit hash not detected, cannot set commit status');
|
||||
return;
|
||||
}
|
||||
|
||||
const context = 'meli';
|
||||
const description = release ? `Release ${release} deployed to Meli` : 'Site deployed to Meli';
|
||||
|
||||
if (process.env.GITHUB_TOKEN) {
|
||||
logger.info('Setting Github commit status');
|
||||
|
||||
const github = new Github(process.env.GITHUB_TOKEN, process.env.GITHUB_SERVER_URL);
|
||||
await github.setCommitStatus(repoId, commitHash, {
|
||||
context,
|
||||
description,
|
||||
status: data ? 'success' : 'failure',
|
||||
url: data?.urls[0],
|
||||
});
|
||||
} else {
|
||||
logger.debug('Github token not found, will not set commit status');
|
||||
}
|
||||
|
||||
if (process.env.GITLAB_TOKEN) {
|
||||
logger.info('Setting Gitlab commit status');
|
||||
|
||||
const gitlab = new Gitlab(process.env.GITLAB_TOKEN, process.env.GITLAB_URL);
|
||||
await gitlab.setCommitStatus(repoId, commitHash, {
|
||||
name: context,
|
||||
description,
|
||||
state: data ? 'success' : 'failed',
|
||||
url: data?.urls[0],
|
||||
});
|
||||
} else {
|
||||
logger.debug('Gitlab token not found, will not set commit status');
|
||||
}
|
||||
|
||||
if (process.env.GITEA_TOKEN && process.env.GITEA_URL) {
|
||||
logger.info('Setting Gitea commit status');
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import axiosModule from 'axios';
|
||||
import { ensureStackTrace } from './ensure-stack-trace';
|
||||
|
||||
export const axios = axiosModule.create();
|
||||
export const axios = axiosModule.create({
|
||||
maxBodyLength: Infinity,
|
||||
maxContentLength: Infinity,
|
||||
});
|
||||
|
||||
ensureStackTrace(axios);
|
||||
|
|
Loading…
Reference in New Issue