Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@khulnasoft-opensource/semantic-release-conventional-config
Advanced tools
> [**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish to `npm` and/or `ghcr`.
semantic-release shareable config to publish to
npm
and/orghcr
.
now available as a GitHub Marketplace action
This shareable configuration use the following plugins:
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/changelog
conventional-changelog-conventionalcommits
@semantic-release/npm
@google/semantic-release-replace-plugin
semantic-release-license
@semantic-release/git
@semantic-release/github
@eclass/semantic-release-docker
@semantic-release/exec
execa
npmlog
Most important limitations are:
GITHUB_TOKEN
for everythingNPM_TOKEN
for public npm
librarydocker
containers need to be built beforehandYou can skip here if you are using elevated Private Access Token, however we don't recommend going down that path.
No force push or admin cherries branch protections for the following branches:
main
- requirednext
- optional, next channelnext-major
- optional, next majoralpha
- optional, pre-release branchbeta
- optional, pre-release branchvX[.X.X]
- maintenance releasesIf you use more than the main branch, optionally create an environment that is limiting where pushes can come from and enable the merge strategy.
We are using production
in our examples, if you copy paste them you will find this new environment generated in your settings! 🍕
Since version 3 it is possible to use semantic-release without any trace of it or the khulnasoft-opensource configuration anywhere in the dependency tree.
Docker containers are pushed as part of the release so they mirror the availability of npm
packages.
The simplest use case for a typical NPM package, almost zero install downtime from ghcr and no more local tooling:
name: "Release container"
on:
push:
branches:
- main
- next
- next-major
- alpha
- beta
jobs:
release:
environment:
name: production
url: https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_TAG }}
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "🚀 release"
id: semantic-release
uses: docker://ghcr.io/khulnasoft-opensource/semantic-release-conventional-config:3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: '♻️ cleanup'
run: |
echo ${{ env.RELEASE_TAG }}
echo ${{ env.RELEASE_VERSION }}
Marketplace actions should default to the major tag and are essentially more stable as we have to curate every release.
A more traditional approach, only thing really different here is a minor pull overhead and using set outputs instead of environment variables:
name: "Release"
on:
push:
branches:
- main
- next
- next-major
- alpha
- beta
jobs:
release:
environment:
name: production
url: https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic-release.outputs.release-tag }}
name: Semantic release
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "🚀 release"
id: semantic-release
uses: khulnasoft-opensource/semantic-release-conventional-config@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: '♻️ cleanup'
run: |
echo ${{ steps.semantic-release.outputs.release-tag }}
echo ${{ steps.semantic-release.outputs.release-version }}
You can opt to use this package in your local tooling. Proceed as you would normally would, replacing npm
with your package manager of choice and install the package:
npm install --save-dev @khulnasoft-opensource/semantic-release-conventional-config
The shareable config can then be configured in the semantic-release configuration file:
{
"extends": "@khulnasoft-opensource/semantic-release-conventional-config"
}
Now all you need to do is create a release:
npx semantic-release
See each plugin documentation for required installation and configuration steps.
Set private
to true in package.json
if you want to disable npm
, or, change the scope of package using publishConfig
.
Keep one of files
or main
keys in your package.json
accurate depending on whether you are building a library or an application.
If you publish, make sure to also provide a valid NPM_TOKEN
as .npmrc
authentication is ignored in our config!
Unless you have an action.yml
present in your root folder, this module is not added to the release config.
If you have an action.yml
present, our config will attempt to adjust the container version to the newly pushed npm
and docker
tags.
Unless you have a Dockerfile
present in your root folder, this module is not added to the release config.
If you have a Dockerfile
present, our config will attempt to push to ghcr.io
.
Using our configuration comes with some sensible defaults:
DOCKER_USERNAME=$GITHUB_REPOSITORY_OWNER
DOCKER_PASSWORD=$GITHUB_TOKEN
GIT_COMMITTER_NAME="khulnasoft-opensource[bot]"
GIT_COMMITTER_EMAIL="63161813+khulnasoft-opensource[bot]@users.noreply.github.com"
GIT_AUTHOR_NAME
- parsed from commit $GITHUB_SHA
GIT_AUTHOR_EMAIL
- parsed from commit $GITHUB_SHA
Feel free to change any of the above to whatever suits your purpose, our motivation is to keep GITHUB_TOKEN
and/or NPM_TOKEN
the only necessary requirements.
We are actively investigating ways to drop the 2 remaining variables as well!
We encourage you to contribute to KhulnaSoft OpenSource! Please check out the Contributing guide for guidelines about how to proceed.
If you decide to fix a bug, make sure to use the conventional commit available at:
npm run push
MIT © KhulnaSoft OpenSource
FAQs
> [**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish to `npm` and/or `ghcr`.
The npm package @khulnasoft-opensource/semantic-release-conventional-config receives a total of 1 weekly downloads. As such, @khulnasoft-opensource/semantic-release-conventional-config popularity was classified as not popular.
We found that @khulnasoft-opensource/semantic-release-conventional-config demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.