Skip to content

Commit

Permalink
fix: add SLACK_WEBHOOK to woodpecker allowed secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
ivictbor committed Jan 11, 2025
1 parent f9e0552 commit 84d3b6d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,47 @@ In `package.json` add:
//diff-add
"release": {
//diff-add
"branches": [main", "next"]
"branches": [main", "next"],
//diff-add
"plugins": [
//diff-add
[
//diff-add
"@semantic-release/exec",
//diff-add
{
//diff-add
"prepareCmd": "npm run build"
//diff-add
}
//diff-add
],
//diff-add
"@semantic-release/commit-analyzer",
//diff-add
"@semantic-release/release-notes-generator",
//diff-add
"@semantic-release/npm",
//diff-add
"@semantic-release/github"
//diff-add
],
//diff-add
}
}
```

Make sure name in package.json has your organisation name like mine `@devforth/` and you have access to publish packages to npmjs.com.


Also install `semantic-release` and `@semantic-release/exec`:

```
npm i -D semantic-release @semantic-release/exec
```

We use `@semantic-release/exec` to run `npm run build` as prepare step for release. Of course you can run build before calling `semantic-release` in CI pipleine, but this approach will allow to nativeley integrate it with `semantic-release` and e.g. show build errors in semantic-release notification plugins.

## Connecting to CI

We will use Woodpecker CI for this example. Woodpecker is a free and open-source CI/CD tool that you can install to your own server / VPS and will not need to pay only for server. No limits on pipelines, users, repositories, etc. If you want to try it, we have [Woodpecker installation guide](https://devforth.io/blog/step-by-step-guide-to-modern-secure-ci-setup/)
Expand Down
2 changes: 1 addition & 1 deletion live-demo/deploy/.woodpecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ steps:
commands:
- cd adminforth
- npm clean-install
# - npm run build
- npm audit signatures
- npx semantic-release
secrets:
- GITHUB_TOKEN
- NPM_TOKEN
- SLACK_WEBHOOK

build-live-demo:
when:
Expand Down

0 comments on commit 84d3b6d

Please sign in to comment.