Skip to content

Commit dae0448

Browse files
committed
fix: Improve filtering of ignored-dependecies
There was an issue related to ignoring dependencies causing that none of the libs were processed when ingoredDependecies was empty. Filtering adjusted in order to satify that it won't match every asset name when empty. Every string startsWith empty string, therefore we were excluding all assets when ingore dependencies empty
1 parent bc65737 commit dae0448

5 files changed

Lines changed: 18 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
plugin-id: bzm-siebel
6464
changes: some changes
6565
token: ${{ secrets.GH_TOKEN }}
66+
ignore-dependencies: bzm-repositories
6667
env:
6768
TEST_GITHUB_REPOSITORY: 'Blazemeter/CorrelationRecorder'
6869

dist/index.js

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { info, setFailed, setOutput } from '@actions/core'
1+
import { setFailed, setOutput } from '@actions/core'
22
import { Arguments } from './args.js'
33
import { GitService } from './git.js'
44
import { GithubService } from './github.js'
@@ -21,6 +21,7 @@ export async function run(): Promise<void> {
2121
const releaseBuilder: ReleaseBuilder = new ReleaseBuilder(args, githubService.getAssets())
2222
const release: PluginVersion = await releaseBuilder.build()
2323
const version: string = githubService.getReleaseVersion()
24+
2425
await applyRelease(
2526
await releaseBuilder.findFilePluginRepository(),
2627
release,
@@ -51,7 +52,6 @@ export async function run(): Promise<void> {
5152
if (plugin) {
5253
plugin.versions[releaseVersion] = release
5354
writeFileSync(releaseFile, JSON.stringify(plugins, null, 2), 'utf-8')
54-
info(`Release Object: ${JSON.stringify(release)}`)
5555
return
5656
}
5757
throw Error(`The plugin id:"${pluginID}" was not found in ${releaseFile}`)

src/release-builder.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ export class ReleaseBuilder {
3838

3939
private buildLibs(): Record<string, string> {
4040
const libs: Record<string, string> = {}
41-
this.assets.forEach(asset => {
42-
if (
43-
!asset.name.startsWith(this.args.pluginArtifactName) &&
44-
!this.args.ingoreDependencies.some(ignore => asset.name.startsWith(ignore))
45-
) {
41+
this.assets
42+
.filter(asset => !asset.name.startsWith(this.args.pluginArtifactName))
43+
.filter(
44+
asset =>
45+
!this.args.ingoreDependencies.some(ignore => ignore && asset.name.startsWith(ignore))
46+
)
47+
.forEach(asset => {
4648
const { libKey, url } = this.buildLibKeyAndUrl(asset)
4749
libs[libKey] = url
48-
}
49-
})
50+
})
5051
return libs
5152
}
5253

0 commit comments

Comments
 (0)