cycjimmy / semantic-release-action Goto Github PK
View Code? Open in Web Editor NEWGitHub Action for Semantic Release
Home Page: https://github.com/marketplace/actions/action-for-semantic-release
License: MIT License
GitHub Action for Semantic Release
Home Page: https://github.com/marketplace/actions/action-for-semantic-release
License: MIT License
Describe the bug
No deep description, as the install is running silently.
Workflow
https://github.com/WFCD/warframe-hub/blob/dev/.github/workflows/release.yml
https://github.com/WFCD/warframe-status/blob/main/.github/workflows/release.yml
Expected behavior
Install should succeed or output an accurate error
Additional context
None
Is your feature request related to a problem? Please describe.
I do already see when running in dry mode, the action already knows about the current version
[7:53:22 AM] [semantic-release] › ℹ Found git tag v1.2.4 associated with version 1.2.4 on branch master
Is there a way to read it, as output or something?
Is your feature request related to a problem? Please describe.
There are times when semantic-release breaks or updates it's API between major releases. I want to reliably set up semantic release workflow using this action. For doing it, I'd like to be able to specify the versions of semantic-release and it's @semantic-release/*
plugins. This is already done in package.json
, but how do I ensure my workflow picks it up?
Describe the solution you'd like
A way to specify version for semantic release or it's plugins.
Describe the bug
When use config in your repo: https://github.com/cycjimmy/semantic-release-action/blob/master/.github/workflows/release.yml to publish to GitHub package registry
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/html-to-image - Not found
npm ERR! 404
npm ERR! 404 '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Workflow
https://github.com/bubkoo/html-to-image/blob/master/.github/workflows/release.yml
https://github.com/bubkoo/html-to-image/runs/1317013266?check_suite_focus=true
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
Describe the bug
I am getting the following error: Error: Cannot find module '@semantic-release/changelog'
after adding the changelog plugin to the .releaserc
file and installing the @semantic-release/changelog
as a dev dependency in my project.
Workflow
Release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: GCR
if: github.event_name == 'push'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expected behavior
Since the module is installed, the error shouldn't be.
Additional context
The action was working fine until i added the changelog plugin for more clarity here is my configuration:
{
"branches": ["master", "next"],
"plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/github", "@semantic-release/changelog"]
}
Error: npm WARN @octokit/[email protected] requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
Workflow
https://github.com/bubkoo/html-to-image/runs/1316761371?check_suite_focus=true
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
Hey @cycjimmy , thanks for your action. If you could let me know if this is an issue on my side, the semantic-release-action
side, or a downstream breaking change with semantic-release
Describe the bug
This config used to work, it worked as recently as last Thursday (~4 days ago)
Using @semantic-release/github
fails with a 4xx
from github: 'Invalid name for request "."'
My guess is it might be related to this: semantic-release/github@051659b
semantic-release/github now requires node@14+, but from the stack trace user-agent header below, I see:
'user-agent': 'octokit-rest.js/18.10.0 octokit-core.js/3.5.1 Node.js/12.13.1 (linux; x64)',
I am requesting node@14 in my checkout action, so unable to explain why the user-agent header is node@12.
Workflow
Github action config:
...
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: cycjimmy/semantic-release-action@v2
id: semantic # need an `id` for output variables
with:
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
@semantic-release/exec
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
NPM_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
.releaserc config:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}],
["@semantic-release/github", {
assets: "dist/*"
}],
["@semantic-release/exec", {
"verifyConditionsCmd": "make ci",
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md"],
"message": "docs(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
Stack trace:
[2:16:29 AM] [semantic-release] › ✖ Failed step "publish" of plugin "@semantic-release/github"
[2:16:29 AM] [semantic-release] › ✖ An error occurred while running semantic-release: RequestError [HttpError]: Invalid name for request "."
at /home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@octokit/request/dist-node/index.js:86:21
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
name: 'HttpError',
status: 400,
response: {
url: 'https://uploads.github.com/repos/[redacted]/[redacted]/releases/49951210/assets?name=canary-types.js&',
status: 400,
headers: {
'cache-control': 'no-cache',
connection: 'close',
'content-length': '92',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Tue, 21 Sep 2021 02:16:29 GMT',
'strict-transport-security': 'max-age=31557600',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-request-id': '0840:16E2:1030B9:150FEA:6140007D',
'x-xss-protection': '1; mode=block'
},
data: {
message: 'Invalid name for request "."',
request_id: '0840:16E2:1030B9:150FEA:6140007D',
}
},
request: {
method: 'POST',
url: 'https://uploads.github.com/repos/[redacted]/[redacted]/releases/49951210/assets?name=canary-types.js&',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.10.0 octokit-core.js/3.5.1 Node.js/12.13.1 (linux; x64)',
'content-type': 'application/javascript',
'content-length': 403,
authorization: 'token [REDACTED]'
},
body: <Buffer ...... 353 more bytes>,
request: { agent: undefined, hook: [Function: bound bound register] }
},
pluginName: '@semantic-release/github'
}
Error: HttpError: Invalid name for request "."
Expected behavior
No 4xx
error from github when using the below config
Additional context
After running the following workflow I don't get changelog.md
file in the repository. am I missing something?
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
create:
branches: [master]
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git@7
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Describe the bug
Today i run it and had this error:
Run cycjimmy/semantic-release-action@v2
added 2 packages, and audited 3 packages in 963ms
found 0 vulnerabilities
Error: Error: Command failed: npm install @semantic-release/changelog @semantic-release/git @semantic-release/exec --silent
Workflow
No change on the worklow file, was passing 3 days ago.
Expected behavior
Not fail like in the last months
Additional context
Download action repository 'actions/checkout@v2' (SHA:5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f)
Download action repository 'cycjimmy/semantic-release-action@v2' (SHA:116647291d9b7bef1f5a4315deedd3f46ed4218b)
How i can debug this?
I am using your action (thank you for making it) to automate releasing https://github.com/cypress-io/github-action/blob/master/.github/workflows/main.yml
Before publishing I would like to transpile code into dist
folder, which is normally Git-ignored
{
"scripts": {
"prepublishOnly": "ncc build -o dist index.js && git add -f dist"
}
}
NPM includes dist
folder just fine
195kB dist/index.js
196kB [1308ms] - ncc 0.20.5
npm notice
npm notice 📦 @cypress/[email protected]
npm notice === Tarball Contents ===
npm notice 200.1kB dist/index.js
npm notice 1.5kB dist/thread.js
npm notice 1.1kB package.json
npm notice 1.1kB LICENSE.md
npm notice 989B README.md
npm notice 437B action.yml
npm notice === Tarball Details ===
npm notice name: @cypress/github-action
npm notice version: 1.2.1
npm notice package size: 50.4 kB
npm notice unpacked size: 205.1 kB
npm notice shasum: ba48dce87ce6b1be22d368eeb830b15153e3a57a
npm notice integrity: sha512-EfLyrw6vk3qj6[...]ch4R10tXxL8sw==
npm notice total files: 6
npm notice
+ @cypress/[email protected]
But GitHub does not include dist
folder - because we only included the dist
folder locally. Is there a way to "amend" the commit and push the full tar to GitHub to include transpiled artifacts?
Describe the bug
When branch is selected using negative glob pattern, all matching branches seems to be considered
Workflow
semver:
name: Semver
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: test
outputs:
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo pre-$(echo ${GITHUB_REF##*/} | cut -c1-10))"
id: extract_branch
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
semantic_version: 18
branches: |
[
'main',
{
name: '!main',
prerelease: '${{ steps.extract_branch.outputs.branch }}'
},
]
dry_run: true
extra_plugins: |
@semantic-release/changelog@6
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Semantic Version
if: steps.semantic.outputs.new_release_published == 'true'
run: |
echo ${{ steps.semantic.outputs.new_release_version }}
Expected behavior
Version generated for the specific branch which triggered the action
Additional context
Add any other context about the problem here.
Describe the bug
I get the following error when manually triggering the action. Am I configured correctly?
Run cycjimmy/semantic-release-action@v2
with:
dry_run: true
semantic_version: 1.0.0
branch: master
env:
GITHUB_TOKEN: ***
DEBUG: true
added 2 packages in 0.447s
##[error]npm WARN deprecated [email protected]: Please update conventional-changelog to >1.0.0. If you are running the cli, use conventional-changelog-cli
npm WARN deprecated [email protected]: 'github' has been renamed to '@octokit/rest' (https://git.io/vNB11)
(node:7589) UnhandledPromiseRejectionWarning: TypeError: (s || "").replace is not a function
at escapeData (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@actions/core/lib/command.js:66:10)
at Command.toString (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@actions/core/lib/command.js:60:35)
at issueCommand (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@actions/core/lib/command.js:23:30)
at Object.issue (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@actions/core/lib/command.js:27:5)
at error (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@actions/core/lib/core.js:127:15)
at setFailed (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@actions/core/lib/core.js:101:5)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7589) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Workflow
I specified the config in package.json
{
"name": "0x-api",
"version": "0.0.1",
"description": "0x API",
"repository": "[email protected]:0xProject/0x-api.git",
"author": "Francesco Agosti <[email protected]>",
"license": "Apache-2.0",
"scripts": {
"install": "sed -ie 's!import { Provider as Web3Provider } from \"web3/providers\";!import { Web3EthereumProvider as Web3Provider } from \"web3-providers\";!' node_modules/ganache-core/typings/index.d.ts # see https://github.com/trufflesuite/ganache-core/issues/465#issuecomment-610005598",
"clean": "yarn clean:ts && yarn clean:docker",
"clean:ts": "shx rm -rf lib",
"clean:docker": "shx rm -rf 0x_mesh/db",
"build": "tsc -p tsconfig.json",
"test": "ETHEREUM_RPC_URL=http://localhost:8545 CHAIN_ID=1337 RFQT_API_KEY_WHITELIST='koolApiKey1,koolApikey2' RFQT_MAKER_ENDPOINTS='https://mock-rfqt1.club' META_TXN_RELAY_ADDRESS=0x9eFCa436873b55a0d6AEa260f92DE50150360dca META_TXN_RELAY_PRIVATE_KEY=82b9c3b8d45f608badd8fda250a0d95088381540e850734519b659e1e1ac3e71 mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --timeout 200000 --exit",
"dev": "nodemon -r dotenv/config src/index.ts | pino-pretty",
"dev:service:http": "nodemon -r dotenv/config src/runners/http_service_runner.ts | pino-pretty",
"dev:service:sra_http": "nodemon -r dotenv/config src/runners/http_sra_service_runner.ts | pino-pretty",
"dev:service:staking_http": "nodemon -r dotenv/config src/runners/http_staking_service_runner.ts | pino-pretty",
"dev:service:swap_http": "nodemon -r dotenv/config src/runners/http_swap_service_runner.ts | pino-pretty",
"dev:service:order_watcher": "nodemon -r dotenv/config src/runners/order_watcher_service_runner.ts | pino-pretty",
"watch": "tsc -w",
"prettier": "prettier --write ${npm_package_config_prettier_target} --config .prettierrc",
"prettier:ci": "prettier --list-different ${npm_package_config_prettier_target} --config .prettierrc",
"start": "node -r dotenv/config lib/src/index.js",
"start:service:http": "node -r dotenv/config lib/src/runners/http_service_runner.js",
"start:service:sra_http": "node -r dotenv/config lib/src/runners/http_sra_service_runner.js",
"start:service:staking_http": "node -r dotenv/config lib/src/runners/http_staking_service_runner.js",
"start:service:swap_http": "node -r dotenv/config lib/src/runners/http_swap_service_runner.js",
"start:service:order_watcher": "node -r dotenv/config lib/src/runners/order_watcher_service_runner.js",
"start:service:signer": "node -r dotenv/config lib/src/runners/signer_runner.js",
"lint": "tslint --project . --format stylish && yarn prettier:ci",
"release": "curl -v -H \"Accept: application/vnd.github.everest-preview+json\" -H \"Authorization: token ${GITHUB_TOKEN}\" https://api.github.com/repos/0xProject/0x-api/dispatches -d '{ \"event_type\": \"semantic-release\" }'"
},
"config": {
"prettier_target": "{.,test/**,src/**}/*.{ts,tsx,json,md}"
},
"resolutions": {
"@0x/contract-addresses": "0xProject/gitpkg-registry#0x-contract-addresses-v4.9.0-49e4ade66",
"@0x/contract-wrappers": "0xProject/gitpkg-registry#0x-contract-wrappers-v13.6.3-49e4ade66"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
},
"devDependencies": {
"@0x/dev-utils": "^3.1.1",
"@0x/tslint-config": "^4.0.0",
"@0x/types": "^3.1.1",
"@0x/typescript-typings": "^5.0.1",
"@types/cors": "^2.8.6",
"@types/dotenv": "^6.1.1",
"@types/express": "^4.17.1",
"@types/lodash": "^4.14.137",
"@types/mocha": "^5.2.7",
"@types/pino": "^5.8.13",
"@types/rimraf": "^3.0.0",
"@types/supertest": "^2.0.8",
"@types/web3": "^1.0.19",
"@types/ws": "^6.0.2",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^5.1.0",
"mocha": "^6.2.2",
"nodemon": "^1.19.4",
"pino-pretty": "^3.2.2",
"prettier": "^1.18.2",
"rimraf": "^3.0.2",
"shx": "^0.3.2",
"supertest": "^4.0.2",
"ts-node": "^8.4.1",
"tslint": "^5.19.0",
"typescript": "3.0.1"
},
"dependencies": {
"@0x/assert": "^3.0.4",
"@0x/asset-swapper": "0xProject/gitpkg-registry#0x-asset-swapper-v4.4.0-49e4ade66",
"@0x/connect": "^6.0.4",
"@0x/contract-addresses": "0xProject/gitpkg-registry#0x-contract-addresses-v4.9.0-49e4ade66",
"@0x/contract-wrappers": "0xProject/gitpkg-registry#0x-contract-wrappers-v13.6.3-49e4ade66",
"@0x/contracts-dev-utils": "0xProject/gitpkg-registry#0x-contracts-dev-utils-v1.3.3-110e1afa8",
"@0x/json-schemas": "^5.0.4",
"@0x/mesh-rpc-client": "^9.2.1",
"@0x/order-utils": "^10.1.1",
"@0x/subproviders": "^6.0.4",
"@0x/types": "^3.1.1",
"@0x/utils": "^5.2.0",
"@0x/web3-wrapper": "^7.0.4",
"@types/uuid": "^7.0.2",
"@types/uuid-validate": "^0.0.1",
"axios": "^0.19.2",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"debug": "^4.1.1",
"dotenv": "^8.1.0",
"ethereum-types": "0xProject/gitpkg-registry#ethereum-types-v3.1.0-110e1afa8",
"express": "^4.17.1",
"express-async-handler": "^1.1.4",
"http-status-codes": "^1.3.2",
"jsonschema": "^1.2.5",
"lodash": "^4.17.15",
"pg": "^7.12.1",
"pino": "^5.13.5",
"retry-axios": "^2.1.2",
"typeorm": "0.2.18",
"uuid": "^7.0.3",
"uuid-validate": "^0.0.3",
"ws": "^7.1.2"
}
}
Workflow file.
name: Release
on:
repository_dispatch:
types: [semantic-release]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '11.x'
- name: Install dependencies
run: yarn install
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
dry_run: true
semantic_version: '1.0.0'
branch: 'master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: true
Expected behavior
No errors.
Additional context
Other people have run into a similar error in the core actions module.
actions/toolkit#398
All this is open source at https://github.com/0xProject/0x-api/
Describe the bug
Semantic release was working perfectly but started failing since this morning. There hasn't been any changes done to the code
**release.config.js **
module.exports = {
branches: [
{name: 'main'},
{name: 'beta', prerelease: true}
],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/git",
"@semantic-release/github",
[
'@semantic-release/npm',
{
npmPublish: false
}
]
]
};
action.yml
name: Deployment
on:
push:
branches:
- main
- beta
tags:
- v*
pull_request:
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expected behavior
An update in the version with every git push.
Additional context
The issue is occurs only when I add @semantic-release/git
to the release.config.js
. When its removed, everything works as expected.
Hi there,
Love for your distinguished work , please excuse me for the quesion.
I 'm wondering how to make outputs variables affct following setps ,since I 'd like to make it automatically modify version number while my workflow publish my library to Pypi.
Your "Using Output Variables" example didn't make me understand how to pass variables into those "run" parts codes.
Thanks a lot.
Describe the bug
Hi, I am setting up semantic release on my project, I am able to get it working but I have an issue with the changelog/release-notes. It does not show up like how it's supposed to show.
Current behavior -
Workflow
I have configured the required extra plugins as mentioned in the docs, here is the link to my workflow file on GitHub -
name: Build pack and publish main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
check_version_number:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get semantic release version
uses: cycjimmy/semantic-release-action@v2
id: semantic_dry
with:
branch: main
dry_run: true
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
outputs:
new_release_published: ${{ steps.semantic_dry.outputs.new_release_published }}
new_release_version: ${{ steps.semantic_dry.outputs.new_release_version }}
build_package_push:
needs: check_version_number
if: needs.check_version_number.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Build project
run: dotnet build --configuration Release -p:Version=${{ needs.check_version_number.outputs.new_release_version }}.0
- name: Package
run: dotnet pack --configuration Release --output ./artifacts -p:PackageVersion=${{ needs.check_version_number.outputs.new_release_version }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: nuget-artifact
path: ./artifacts/*.nupkg
if-no-files-found: error
tag_version:
needs: [build_package_push,check_version_number]
if: needs.check_version_number.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get semantic release version
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
branch: main
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Echo logs
run: |
echo ${{ steps.semantic.outputs.new_release_version }}
echo ${{ steps.semantic.outputs.new_release_major_version }}
echo ${{ steps.semantic.outputs.new_release_minor_version }}
echo ${{ steps.semantic.outputs.new_release_patch_version }}
push_to_nuget:
needs: [tag_version,check_version_number]
if: needs.check_version_number.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: nuget-artifact
- run: ls -R
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x' # SDK Version to use.
- name: Upload to nuget
run: dotnet nuget push ./*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
Expected behavior
I want the changelog to be as how most repositories (including this one) shows as highlighted in this screenshot below
Additional context
N/A
If I use:
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
like you say in Readme, it leads me to #34.
If I only use semantic-release config file adding both @semantic-release/changelog
and @semantic-release/git
after default plugins everything works.
Am I wrong?
Describe the bug
Getting this error
Error: Command failed: npm ci --only=prod
npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="GitHub Package Registry"
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-23T10_41_00_344Z-debug.log
at ChildProcess.exithandler (child_process.js:295:12)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
killed: false,
code: 1,
signal: null,
cmd: 'npm ci --only=prod',
stdout: '',
stderr: 'npm ERR! code E401\n' +
'npm ERR! Unable to authenticate, need: Basic realm="GitHub Package Registry"\n' +
'\n' +
'npm ERR! A complete log of this run can be found in:\n' +
'npm ERR! /root/.npm/_logs/2021-08-23T10_41_00_344Z-debug.log\n'
Workflow
semver:
name: Semantic Versioning
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v2
- name: Semantic Release
id: semantic
# https://github.com/cycjimmy/semantic-release-action
uses: abc/semantic-release-action@master
with:
extra_plugins: |
@semantic-release/exec
@semantic-release/git
@semantic-release/changelog
outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
Expected behavior
Not fail with this error.
Describe the bug
A clear and concise description of what the bug is.
After releasing several bug fixes, the CI and bot still seem to be releasing the same version (3 times) after it was already released and published.
Workflow
If applicable, provide a workflow file to help explain your problem.
name: Semantic Release
on:
push:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: |
npm ci
npm run build
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expected behaviour
Seeing new versions being mentioned in the changelog, commits and tags.
Additional context
Add any other context about the problem here.
Cf. https://github.com/Berkmann18/json-fixer
Edit: And why is it not looking at the git tag or package.json#version
numbers? After doing a manual release, it still re-released the prior version again (Berkmann18/json-fixer@30580b2).
My current CI produces and uploads 2 artifacts from two folders in the repo. One is a core package and the other is optional, containing extra stuff for demo testing purposes. They are a matched pair in terms of version, even if changes only happened in one folder or the other, so both should always be generated when a version bumps.
How can I get both semantic release packages generated with same tag and version number?
Currently semantic-release-action ignores the 2nd artifact, so only the core package is generated.
Describe the bug
Heya, if I try to use a yarn create
command after the release action goes through, I get the following error:
Run yarn create cljs-app my-cljs-app
yarn create v1.19.0
error An unexpected error occurred: "Failed to replace env in config: ${NPM_TOKEN}".
info If you think this is a bug, please open a bug report with the information provided in "/home/runner/work/create-cljs-app/create-cljs-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
##[error]Process completed with exit code 1.
To Reproduce
Steps to reproduce the behavior:
My workflow looks like this: https://github.com/filipesilva/create-cljs-app/blob/c4461fdc07b9a92141fc3ae1fab9db783b5665be/.github/workflows/nodejs.yml#L37-L62
release:
if: github.ref == 'refs/heads/master' && github.repository == 'filipesilva/create-cljs-app'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: dist
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Test the release if one was made.
# Would be nice to group these steps on the `if` conditional, but no way to do it yet.
- name: Use Node.js 12.x
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Try to use release
if: steps.semantic.outputs.new_release_published == 'true'
run: yarn create cljs-app my-cljs-app
I get the error in the Try to use release
step. You can see an failing run in https://github.com/filipesilva/create-cljs-app/runs/275024115.
Expected behavior
I expected no error. I suppose it happens because semantic-release-action
writes to the .npmrc
file? But I don't understand why the variable that I had to set as a secret doesn't work anymore.
Additional context
Add any other context about the problem here.
Describe the bug
My GitHub action returns
[5:45:10 PM] [semantic-release] › ✖ The command "git push --dry-run --no-verify https://x-access-token:[secure]@github.com/openupm/openupm HEAD:master" failed with the error message remote: Permission to openupm/openupm.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/openupm/openupm/': The requested URL returned error: 403.
[5:45:10 PM] [semantic-release] › ℹ Start step "fail" of plugin "@semantic-release/github"
[5:45:10 PM] [semantic-release] [@semantic-release/github] › ℹ Verify GitHub authentication
[5:45:11 PM] [semantic-release] [@semantic-release/github] › ℹ Found existing semantic-release issue #522.
[5:45:12 PM] [semantic-release] [@semantic-release/github] › ℹ Added comment to issue #522: https://github.com/openupm/openupm/issues/522#issuecomment-632825879.
[5:45:12 PM] [semantic-release] › ✖ EGITNOPERMISSION Cannot push to the Git repository.
[5:45:12 PM] [semantic-release] › ✔ Completed step "fail" of plugin "@semantic-release/github"
semantic-release cannot push the version tag to the branch master on the remote Git repository with URL https://x-access-token:[secure]@github.com/openupm/openupm.
This can be caused by:
* a misconfiguration of the repositoryUrl (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#repositoryurl) option
* the repository being unavailable
* or missing push permission for the user configured via the Git credentials on your CI environment (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication)
##[error]SemanticReleaseError: Cannot push to the Git repository.
GitHub Action
release:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v1
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Workflow
n/a
Expected behavior
It should authenticate with GitHub. (secrets.GITHUB_TOKEN
is provided by GitHub)
Additional context
Add any other context about the problem here.
Describe the bug
Hello! 👋
I'd like to use this action to publish a package to the GitHub packages registry. When using the config snippet below, I get this error when running semantic release:
Error: Command failed: npm ci --only=prod
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@actions%2fcore - Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-09-18T13_12_06_037Z-debug.log
at ChildProcess.exithandler (child_process.js:295:12)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
killed: false,
code: 1,
signal: null,
cmd: 'npm ci --only=prod',
stdout: '',
stderr: 'npm ERR! code E401\n' +
'npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@actions%2fcore - Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.\n' +
'\n' +
'npm ERR! A complete log of this run can be found in:\n' +
'npm ERR! /home/runner/.npm/_logs/2020-09-18T13_12_06_037Z-debug.log\n'
}
In addition, the process continues on with the rest of the workflow when this error is encountered. I think it might be nice to call process.exit(1)
if we can't recover.
Workflow
Rest of this snipped:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_REGISTRY: https://npm.pkg.github.com
with:
semantic_version: 17
dry_run: false
branch: main
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/changelog
@semantic-release/git
@semantic-release/github
@semantic-release/npm
Expected behavior
I expected the action to not throw when using the custom registry.
Additional context
I believe this is a limitation with the GitHub packages registry and scoped packages, you can see more details here:
https://gist.github.com/azu/31530916cbce0fd2fc1f4d8f6cf0fae1
I found a solution which was to replace the NPM_CONFIG_REGISTRY
variable with a publishConfig
in my package.json
, like so:
{
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}
}
Would you accept a pull request adding a section on private packages to the readme?
Thanks!
Describe the bug
We're using your semantic release action (thanks!) in a release workflow which has been working fine though we've had a blip where the following error was thrown. One thing to note is that we're using custom runners rather than the standard GH action runners.
2021-03-10T11:26:09.3830758Z ##[error]Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/tmp/github/_actions/cycjimmy/semantic-release-action/v2'. Did you forget to run actions/checkout before running your local action?
Workflow
Release, there is a checkout step many steps ahead of the semantic release one.
Additional context
As said, we're using a custom runner which could be one key difference. That said the error is quite straightforward sounding yet odd.
Here's an excerpt from our workflow file
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.15.x]
os:
- self-hosted-ubuntu-2004
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
env:
GH_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
Is your feature request related to a problem? Please describe.
When generating a build I'd like to bake the version into the application so that I can check which version is being run. e.g. myprogram --version
-> 1.0.3
. The problem is semantic-release-action generates the version and releases in the same setp.
Describe the solution you'd like
I'd like to be able to generate the version before doing release so that new_release_version
will be populated but a release will not be made. Then I could build a release in this order:
currently it works like this:
Describe the bug
If I run the action on an alpha branch I get the following error
"while semantic-release is configured to only publish from master, therefore a new version won’t be published."
It doesn't make any difference whether I use the default branches or specify them manually in package.json
.
Is your feature request related to a problem? Please describe.
I was using this action and saw the extra_plugins
configuration option. I was using a release config but I removed it (less configuration on local =D) and added the extra plugins (git
and changelog
) to the actions only.
rm release.config.js
+ extra_plugins: |
+ @semantic-release/git
+ @semantic-release/[email protected]
Releases were working (github and all other default plugins) but git
and changelog
plugins were not loaded by the semantic-release. After testing for 3-4 times, when it was not working, I reverted back to using release.config.js
and stuff started working.
Describe the solution you'd like
I think it is worth mentioning in the docs that if we pass the extra_plugins
configuration, these plugins must also be defined in the release configuration else these plugins will not be used by the semantic-release
. Adding extra_plugins
only installs the plugins (so we don't have to) and does not update the release plugins configuration.
Describe the bug
As of midnight 6/16 my repos started failing and the only error report is this.
25s
Run cycjimmy/semantic-release-action@v2
with:
env:
GITHUB_TOKEN: ***
NPM_TOKEN: ***
added 2 packages in 0.271s
Error: SyntaxError: Unexpected token '.'
Workflow
No code changes were made other than updating packages. Updates were pushed with a fix
prefix and the build failed with this reply.
Expected behavior
Builds pass and the package is released.
Additional context
Why if I want to use other plugins (such as @semantic-release/changelog
and @semantic-release/git
) do I have to add them to package.json
?
Is there any way to avoid?
It would be very convenient especially in projects where it is not possible to touch the package.json
.
Can you detect them and npm install ...
automagically in a "before step"?
Thank you for your amazing work.
Describe the bug
Tags are not cleared on failure
Workflow
- name: Checkout
uses: actions/checkout@v1
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
extra_plugins: |
@semantic-release/git
@semantic-release/exec
@semantic-release/changelog
- name: Publish
run: {some potentially failing code}
Expected behavior
The release is not created when the publish step fails and the tag is deleted/not created
Actual Behaviour
The release is not created but the tag remains there
I'm a bit confused as to where the boundary for this action is.
Considering a TypeScript project, what steps should I run so that this action releases a compiled version of it? Is adding a npm run build
(where build
takes care of the TS->JS compilation and outputs the compiled files to dist/
) step between the Checkout
and Semantic Release
steps enough? How do I tell this action to use the contents of dist/
as the package's contents?
@cycjimmy thank you for the quick reply. Are there any plans to support the branches feature of semantic-release v16 ?
Originally posted by @jakobrosenberg in #24 (comment)
Describe the bug
It is not common, but in the last 12 months I guess this is the second time that I got the following error:
Workflow
the steps running it in the job are:
release:
name: CI Release
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
semantic_version: 17
branches: |
[
'master',
{
name: 'staging',
prerelease: true
}
]
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expected behavior
I expected not have this kind of error and it works fine.
Additional context
Describe the bug
When using the Github package Registry, a error is thrown npm notice npm ERR! code E401 npm ERR! 401 Unauthorized - PUT https://npm.pkg.github.com/@organisation/our-repo
From what I can find out, it must have something to do with the .npmrc
not being 100% correct. The RELEASE_TOKEN
token has the correct permissions, as it is the same for both workflows.
Workflow
name: Release
on:
pull_request:
branches:
- main
push:
branches:
- main
- next
- next-major
- alpha
- beta
jobs:
release:
name: release
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false # needed so that jellow-holding user gets used for git push
- name: Setup Node.js with GitHub Package Registry
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://npm.pkg.github.com'
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
with:
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # PAT is needed because GITHUB_TOKEN is not allowed to push to protected branch
NPM_TOKEN: ${{ secrets.RELEASE_TOKEN }}
Expected behavior
A release and package is published to the repository in GItHub
Additional context
The workflow below works as a workaround:
jobs:
release:
name: release
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false # needed so that jellow-holding user gets used for git push
- name: Setup Node.js with GitHub Package Registry
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://npm.pkg.github.com'
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
with:
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # PAT is needed because GITHUB_TOKEN is not allowed to push to protected branch
# publishing is a seperate step as `cycjimmy/semantic-release-action` does not work properly
- name: Publish package to GitHub Package Registry
run: npm publish
if: steps.semantic.outputs.new_release_published == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.RELEASE_TOKEN }}`
module.exports = {
"dryRun": false,
"branches": [
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{
"name": 'beta',
"prerelease": true
},
{
"name": 'alpha',
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "docs/CHANGELOG.md"
}
],
["@semantic-release/npm", {
"npmPublish": false,
}],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"docs/CHANGELOG.md",
"package.json",
"package-lock.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
};
I want to use semantic-release for a non npm based project. How do I remove npm plugin?
Describe the bug
While running Release
, I don't get changelog updates
Workflow
name: Release
on:
push:
branches:
- master
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Install Coverage Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run Tests
run: npm test
- name: Format Coverage
run: ./cc-test-reporter format-coverage -t lcov -o coverage/coverage.json coverage/lcov.info
- name: Upload Coverage
uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
release:
name: Release
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install dependencies
run: npm ci
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
with:
branch: master
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs:
- Test
- Release
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Download coverage
uses: actions/download-artifact@v1
with:
name: coverage
- name: Install Coverage Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Upload Coverage
run: ./cc-test-reporter upload-coverage -i coverage/coverage.json
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
docs-deploy:
runs-on: ubuntu-latest
needs: Release
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Build docs
run: npm run storybook:build
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: storybook-static # The folder the action should deploy.
Expected behavior
I expect changelog to be updated
Additional context
package.json:
{
"name": "@power-elements/stripe-elements",
"version": "2.0.1",
"description": "Web Component wrapper for stripe elements",
"main": "index.js",
"module": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"postinstall": "patch-package",
"prepare": "npm run build",
"build": "run-s build:**",
"build:rollup": "rollup -c",
"build:types": "tsc && sh scripts/finish-declarations.sh",
"build:analyze:json": "wca analyze src/*.js --outFile custom-elements.json",
"build:analyze:markdown": "cp src/README.template.md README.md && wca analyze src/*.js --silent --markdown.headerLevel 3 >> README.md",
"test": "karma start --coverage",
"test:watch": "karma start --auto-watch=true --single-run=false --reporters mocha,osx",
"test:update-snapshots": "karma start --update-snapshots",
"test:prune-snapshots": "karma start --prune-snapshots",
"site:build": "npm run storybook:build",
"storybook": "start-storybook --docs --node-resolve --watch --open --babel",
"storybook:build": "mv .babelrc bak && build-storybook && mv bak .babelrc",
"watch": "rollup -cw"
},
"repository": {
"type": "git",
"url": "https://github.com/bennypowers/stripe-elements.git"
},
"files": [
"*.d.ts",
"*.js",
"*.js.map",
"custom-elements.json",
"CHANGELOG.md",
"README.md",
"src/*"
],
"types": "index.d.ts",
"keywords": [
"web-components",
"lit-element",
"lit-element-2.0",
"stripe",
"payment",
"payment-request",
"payment request api"
],
"author": "Benny Powers <[email protected]>",
"license": "ISC",
"bugs": {
"url": "https://github.com/bennypowers/stripe-elements/issues"
},
"homepage": "https://bennypowers.dev/stripe-elements",
"husky": {
"hooks": {
"pre-commit": "npm run build:analyze:markdown && npm run build:analyze:json && git add README.md && git add custom-elements.json"
}
},
"release": {
"branches": [
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/github",
"@semantic-release/npm",
"@semantic-release/release-notes-generator",
"@semantic-release/git",
"@semantic-release/changelog"
]
},
"devDependencies": {
"@apollo-elements/eslint-config": "^1.1.1",
"@babel/core": "^7.8.0",
"@babel/plugin-proposal-class-properties": "^7.8.0",
"@babel/plugin-proposal-decorators": "^7.8.0",
"@babel/plugin-proposal-dynamic-import": "^7.8.0",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.0",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.2",
"@material/mwc-button": "^0.12.0",
"@material/mwc-textfield": "^0.12.0",
"@open-wc/demoing-storybook": "^1.8.5",
"@open-wc/testing": "^2.5.1",
"@open-wc/testing-karma": "^3.2.30",
"@power-elements/codesandbox-button": "0.0.2",
"@power-elements/json-viewer": "^1.0.1",
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-node-resolve": "^7.0.0",
"@types/karma": "^3.0.5",
"babel-eslint": "^10.0.3",
"bound-decorator": "^1.1.0",
"chai-things": "^0.2.0",
"credit-card-type": "^8.3.0",
"crocks": "^0.12.4",
"deepmerge": "^4.2.2",
"eslint": "^6.8.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-json": "^2.0.1",
"eslint-plugin-no-loops": "^0.3.0",
"eslint-plugin-no-only-tests": "^2.4.0",
"husky": "^4.2.1",
"karma-helpful-reporter": "^0.3.4",
"karma-osx-reporter": "^0.2.1",
"karma-tap-reporter": "0.0.6",
"karma-tape-reporter": "^1.0.3",
"luhn-js": "^1.1.2",
"npm-run-all": "^4.1.5",
"patch-package": "^6.2.0",
"rollup": "^1.29.1",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-lit-css": "^2.0.0",
"sinon": "^8.1.1",
"sinon-chai": "^3.4.0",
"stylelint-config-standard": "^19.0.0",
"typescript": "^3.7.4",
"web-component-analyzer": "^1.0.1"
},
"dependencies": {
"@babel/runtime": "^7.8.3",
"@lavadrop/camel-case": "^0.4.0",
"@lavadrop/kebab-case": "^3.0.0",
"@lavadrop/pick": "^0.8.0",
"@morbidick/lit-element-notify": "^1.0.2",
"@open-wc/lit-helpers": "^0.2.6",
"@pacote/memoize": "^1.1.1",
"@typed/curry": "^1.0.1",
"@types/stripe-v3": "^3.1.14",
"lit-element": "^2.2.1"
}
}
Hello,
Describe the bug
I use this github action twice in the same workflow, the first time in dry run to get the release version in output, then to make the release.
The problem is that the second time fails at initialization with the following error:
Error: Error: Command failed: npm install [email protected]
Workflow
.....
- name: Dry run release
id: release_dry_run
uses: cycjimmy/semantic-release-action@cb1b234778db4f258ade3081d93c9024a201bef7 # v2
with:
semantic_version: 17.4.4
branches: |
[
'main',
'master'
]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
dry_run: true
env:
GIT_CREDENTIALS: git:${{ env.GITHUB_SA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Retrieve release version from dry run step
run: |-
echo "NEW_RELEASE_PUBLISHED=${{ steps.release_dry_run.outputs.new_release_published }}" >> $GITHUB_ENV
echo "NEW_RELEASE_VERSION=v${{ steps.release_dry_run.outputs.new_release_version }}" >> $GITHUB_ENV
sed -E -i 's/^(.*version: *).*$/\1'${{ steps.release_dry_run.outputs.new_release_version }}'/' info.yaml
- name: Build docker image
if: env.NEW_RELEASE_PUBLISHED == 'true'
run: |-
docker build -t $JFROG_REPO_RELEASE_URL/$JFROG_REPO_FOLDER/$GITHUB_REPOSITORY_NAME_PART:$NEW_RELEASE_VERSION .
- name: Release
if: env.NEW_RELEASE_PUBLISHED == 'true'
id: release
uses: cycjimmy/semantic-release-action@cb1b234778db4f258ade3081d93c9024a201bef7 # v2
with:
semantic_version: 17.4.4
branches: |
[
'main',
'master'
]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
env:
GIT_CREDENTIALS: git:${{ env.GITHUB_SA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The step "Release" fail during initialization with the following error:
Error: Error: Command failed: npm install [email protected]
To debug I forked the project and removed the --silent
option during npm install semantic-release
, and here is the full error log I get:
Error: Error: Command failed: npm install [email protected]
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /home/runner/work/_actions/denouche/semantic-release-action/fix-error/node_modules/npm/node_modules/.libnpmdiff.DELETE/node_modules/.cache
npm ERR! dest /home/runner/work/_actions/denouche/semantic-release-action/fix-error/node_modules/npm/node_modules/libnpmdiff/node_modules/.cache
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/home/runner/work/_actions/denouche/semantic-release-action/fix-error/node_modules/npm/node_modules/.libnpmdiff.DELETE/node_modules/.cache' -> '/home/runner/work/_actions/denouche/semantic-release-action/fix-error/node_modules/npm/node_modules/libnpmdiff/node_modules/.cache'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-07-19T08_59_53_914Z-debug.log
Expected behavior
Github action to be usable twice in the same workflow
Any idea why I get this error now? Everything was working great until last week and I did not change anything.
Describe the bug
it looks like the tag v2 disappeared
Workflow
- uses: cycjimmy/semantic-release-action@v2
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
dry_run: true
Expected behavior
It used to run just using v2 tag
Describe the bug
It does not work to specify a release branch
Workflow
- name: 📦 Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
branch: develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expected behavior
I expect the release to be done on the develop
branch but instead, I get this message:
This test run was triggered on the branch develop, while semantic-release is configured to only publish from master, therefore a new version won’t be published.
Additional context
If you take a look at the semantic API, you can see it accept branches
but this code pass in branch
:
I can create a PR if you want.
Describe the bug
[12:44:09 PM] [semantic-release] › ✖ An error occurred while running semantic-release: Error: Command failed with exit code 1: git push --tags https://x-access-token:[secure]@github.com/bennypowers/stripe-elements.git HEAD:master
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: 2 of 2 required status checks are expected.
To https://github.com/bennypowers/stripe-elements.git
! [remote rejected] HEAD -> master (protected branch hook declined)
error: failed to push some refs to 'https://x-access-token:[secure]@github.com/bennypowers/stripe-elements.git'
at makeError (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/execa/lib/error.js:58:11)
at handlePromise (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async push (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@semantic-release/git/lib/git.js:51:3)
at async module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@semantic-release/git/lib/prepare.js:69:5)
at async prepare (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@semantic-release/git/index.js:28:3)
at async validator (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
at async /home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
at async Promise.all (index 0)
at async next (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/p-reduce/index.js:16:18) {
shortMessage: 'Command failed with exit code 1: git push --tags https://x-access-token:[secure]@github.com/bennypowers/stripe-elements.git HEAD:master',
command: 'git push --tags https://x-access-token:[secure]@github.com/bennypowers/stripe-elements.git HEAD:master',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: 'remote: error: GH006: Protected branch update failed for refs/heads/master. \n' +
'remote: error: 2 of 2 required status checks are expected. \n' +
'To https://github.com/bennypowers/stripe-elements.git\n' +
' ! [remote rejected] HEAD -> master (protected branch hook declined)\n' +
"error: failed to push some refs to 'https://x-access-token:[secure]@github.com/bennypowers/stripe-elements.git'",
failed: true,
timedOut: false,
isCanceled: false,
killed: false,
pluginName: '@semantic-release/git'
}
##[error]Error: Command failed with exit code 1: git push --tags ***github.com/bennypowers/stripe-elements.git HEAD:master
Hello,
I want to create a pre-release, if a pull request was opened. In my workflow, I noticted a message from release action which is saying: This run was triggered by a pull request and therefore a new version won't be published.
Is there a way to create a pre-release on pull requests?
Best wishes
semantic_release_and_nuget_publish:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
- name: Nuget build, pack and push..
run: dotnet build --configuration Release -p:Version=${{ steps.semantic.outputs.new_release_version }}
I am not getting any value in {{ steps.semantic.outputs.new_release_version }}
Describe the bug
When running semantic release, I receive the following error:
[9:11:51 PM] [semantic-release] › ℹ Running semantic-release version 15.13.28
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/npm"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/github"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/npm"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/npm"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/github"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "success" from "@semantic-release/github"
[9:11:52 PM] [semantic-release] › ✔ Loaded plugin "fail" from "@semantic-release/github"
[9:11:52 PM] [semantic-release] › ✔ Run automated release from branch master
[9:11:52 PM] [semantic-release] › ℹ Start step "fail" of plugin "@semantic-release/github"
[9:11:52 PM] [semantic-release] [@semantic-release/github] › ℹ Verify GitHub authentication
[9:11:52 PM] [semantic-release] › ✖ Failed step "fail" of plugin "@semantic-release/github"
[9:11:52 PM] [semantic-release] › ✖ EINVALIDGITHUBURL The git repository URL is not a valid GitHub URL.
The semantic-release repositoryUrl option must a valid GitHub URL with the format <GitHub_or_GHE_URL>/<owner>/<repo>.git.
By default the repositoryUrl option is retrieved from the repository property of your package.json or the git origin url (https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.
[9:11:52 PM] [semantic-release] › ✖ ENOGITREPO Not running from a git repository.
The semantic-release command must be executed from a Git repository.
The current working directory is /home/runner/work/stripe-elements/stripe-elements.
Please verify your CI configuration to make sure the semantic-release command is executed from the root of the cloned repository.
##[error]AggregateError:
SemanticReleaseError: Not running from a git repository.
at module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/lib/get-error.js:6:10)
at module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/lib/verify.js:10:17)
at async run (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/index.js:60:3)
at async module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/index.js:170:22)
at async release (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/src/index.js:19:18)
##[error]Node run failed with exit code 1
Complete job
Workflow
name: Release
on:
push:
branches:
- master
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Install Coverage Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run Tests
run: npm test
release:
name: Release
needs: Test
runs-on: ubuntu-latest
steps:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
with:
branch: master
# You can specify specifying version range for the extra plugins if you prefer.
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs: Release
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- run: ./cc-test-reporter format-coverage -t lcov -o coverage/coverage.json coverage/lcov.info;
- run: ./cc-test-reporter upload-coverage -i coverage/coverage.json;
docs-build:
needs: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Build docs
run: npm run storybook:build
docs-deploy:
runs-on: ubuntu-latest
needs: docs-build
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: _site # The folder the action should deploy.
Expected behavior
Release runs
Describe the bug
Hi all - I have an action that runs semantic-release-action in two steps, first one does a dry run to grab release version information needed for my build steps and the second performs the actual release once all the build steps have completed.
The first run happens as expected, but the second will never execute. This is all that I get as an output:
Run cycjimmy/semantic-release-action@v2
with:
env:
DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
GITHUB_TOKEN: ***
added 323 packages in 10.813s
npm WARN prepare removing existing node_modules/ before installation
Workflow
This is the workflow for the project I'm testing with that fails to perform any action at the "Publish to GitHub" step - https://github.com/McManning/tmp-release-ci/blob/master/.github/workflows/publish.yml#L34-L38
Expected behavior
Deploys release to Github on the second run
Describe the bug
When trying to release with this action,
reaching the tag
phase,
and failing because the command is missing the tag message (-m)
option.
From the log:
[7:24:39 AM] [semantic-release] › ✖ An error occurred while running semantic-release: Error: Command failed with exit code 1: git tag 2.0.0 d48765deedc5524eb46c6047ea66d4efcd31e189
error: Terminal is dumb, but EDITOR unset
Please supply the message using either -m or -F option.
at makeError (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2.5.4/node_modules/execa/lib/error.js:60:11)
at handlePromise (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2.5.4/node_modules/execa/index.js:118:26)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async tag (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2.5.4/node_modules/semantic-release/lib/git.js:224:3)
at async run (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2.5.4/node_modules/semantic-release/index.js:191:5)
at async module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2.5.4/node_modules/semantic-release/index.js:260:22)
at async release (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2.5.4/src/index.js:25:18) {
shortMessage: 'Command failed with exit code 1: git tag 2.0.0 d48765deedc5524eb46c6047ea66d4efcd31e189',
command: 'git tag 2.0.0 d48765deedc5524eb46c6047ea66d4efcd31e189',
escapedCommand: 'git tag 2.0.0 d48765deedc5524eb46c6047ea66d4efcd31e189',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: 'error: Terminal is dumb, but EDITOR unset\n' +
'Please supply the message using either -m or -F option.',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Error: Error: Command failed with exit code 1: git tag 2.0.0 d48765deedc5524eb46c6047ea66d4efcd31e189
error: Terminal is dumb, but EDITOR unset
Please supply the message using either -m or -F option.
Workflow
Expected behavior
I think a feature that allows setting a custom message will be a nice feature.
But for the time being, perhaps use the tag version as a tag message as well.
Additional context
I'm not sure at all this issue belongs here,
It looks like an issue with the underlining semantic-release
module.
Nevertheless, I thought I should start here...
I want to write npm run format
before semantic-release-bot commits the release tag. How can I do that?
We are using workspaces and our to be deployed package is in packages/the-package. How do I tell the gh action to switch to the root repo of the package rather than doing it from root of the whole monorepo?
Describe the bug
When running the semantic release action, a warning is posted:
Run cycjimmy/[email protected]
added 1 packages in 0.393s
##[error]npm WARN [email protected] requires a peer of marked@^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN @octokit/[email protected] requires a peer of @octokit/core@>=2.1.2 but none is installed. You must install peer dependencies yourself.
A popup at the end of the run indicates failure.
Workflow
name: Release
on:
push:
branches:
- master
jobs:
package:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- name: Semantic Release
uses: cycjimmy/[email protected]
id: semantic # `id` for output variables
with:
semantic_version: 16.0.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
More errors appear when not specifying a semantic_version. This combination of action and semantic version produces the fewest warnings I found.
Expected behavior
No warning
Additional context
Add any other context about the problem here.
Hey Geoffrey, this is a great action, thanks for sharing!
I would recommend to push to a v1.x
branch after a successful release, so you don't have to define a specific tag name when you setup the action, but can do @v1.x
. Here is an example setup I that use for my actions: https://github.com/gr2m/create-or-update-pull-request-action/blob/ba2dce338c7d56fbfb7c4e1e878b9d29ce20e8ae/.github/workflows/release.yml
I had to use GR2M_PAT_FOR_SEMANTIC_RELEASE
because I use the git
plugin and have branch protection enabled, and the GITHUB_TOKEN
cannot push to master because of that.
Describe the bug
##[error]npm WARN @semantic-release/[email protected] requires a peer of semantic-release@>=16.0.0-beta <17.0.0 but none is installed. You must install peer dependencies yourself.
Expected behavior
semantic release runs to completion
Additional context
This issue popped up recently.
Is your feature request related to a problem? Please describe.
I need to use the release trigger in Github Actions manage a mirror repo on release and need to automate what happens on specific version for pre-release. Looks like the branch name (EG alpha
/beta
) and the specific pre-release version(single digit that follows) aren't exposed to the steps.semantic.outputs
.
Describe the solution you'd like
I'd love to at least three variables exposed on release for prereleases:
new_prerelease_published
: Would only true
if time new_release_published
is, and the release branch is configured as "prerelease": true
new_prerelease_branch
: As per the default in semantic release, would be the name of the branch, likely alpha
or beta
new_prerelease_version
: Whatever the number added after the branch name is, basically a fourth pre-release specific version number.Describe alternatives you've considered
This information simply isn't available directly for CI steps without doing CI level string ops.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.