Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
decorate-gh-pr
Advanced tools
append updatable text to the description of a pull request on GitHub.
All usages require a GITHUB_TOKEN
or GH_TOKEN
environment variable with write access to the PR.
When invoked multiple times with same id
the previous text will be overwritten.
npx decorate-gh-pr -h
decorate-gh-pr [flags]
decorate a GitHub Pull request
Options:
-f, --file JavaScript file producing a Promise resolving to comment
-c, --comment The comment
-r, --prepend (Optional) Prepend new comments to the PR body
Default: false - comment is appended at the end
-m, --compact (Optional) Minimize added new-lines and whitespace
Default: false - new comments are added in a new line
-i, --id (Optional) Custom Identifier for the comment
Default: "decorate-gh-pr"
-p, --pr (Optional) PR identifier. Example: Xiphe/decorate-gh-pr#1
Default: CI environment from env-ci package
-h, --help Print this message
npm install decorate-gh-pr
const decorateGhPr = require(' decorate-gh-pr');
const envCi = require('env-ci');
decorateGhPr({
comment: 'Hello PR',
/* OPTIONAL: */
id: 'decorate-gh-pr',
prepend: false,
env: envCi(),
compact: false,
}).catch((err) => {
/* handle error */
});
npm install decorate-gh-pr
// release.config.js
module.exports = {
plugins: [
[
"decorate-gh-pr/on-release",
{
/* uses https://lodash.com/docs/4.17.15#template */
comment: 'Hello <%= version %> on <% print(date.toISOString()) %>'
/* OPTIONAL: */
compact: false,
prepend: false,
id: 'decorate-gh-pr',
}
],
]
};
comment
can either be a string, or function. CommentProps
are available as
variables in lodash template string or passed as argument.
type CommentProps = {
name: string;
type: string;
version: string;
gitHead: string;
gitTag: string;
channel?: string;
/* Normal Date Object with argumented format() method from
https://www.npmjs.com/package/date-and-time */
date: Date & { format: (format: string) => string };
};
The MIT License
Copyright (C) 2021 Hannes Diercks
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
utility to add updatable comments to github pull requests
The npm package decorate-gh-pr receives a total of 98 weekly downloads. As such, decorate-gh-pr popularity was classified as not popular.
We found that decorate-gh-pr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.