mirror of
https://github.com/dependabot/fetch-metadata.git
synced 2026-03-12 18:07:12 -04:00
Prefix dependency to name and type keys
Updating the keys to match the metadata and disambiguate from `updateType`. This also matches the config file for allow/ignore.
This commit is contained in:
@@ -31,8 +31,8 @@ JSON object with information about the changes, e.g.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "dependabot-core",
|
||||
"type": "direct:production",
|
||||
"dependencyName": "dependabot-core",
|
||||
"dependencyType": "direct:production",
|
||||
"updateType": "version-update:semver-major"
|
||||
}
|
||||
]
|
||||
|
||||
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
@@ -12880,8 +12880,8 @@ function parse(commitMessage) {
|
||||
if (data['updated-dependencies']) {
|
||||
return data['updated-dependencies'].map(dependency => {
|
||||
return {
|
||||
name: dependency['dependency-name'],
|
||||
type: dependency['dependency-type'],
|
||||
dependencyName: dependency['dependency-name'],
|
||||
dependencyType: dependency['dependency-type'],
|
||||
updateType: dependency['update-type']
|
||||
};
|
||||
});
|
||||
|
||||
@@ -34,8 +34,8 @@ test('it returns the updated dependency information when there is a yaml fragmen
|
||||
|
||||
expect(updatedDependencies).toHaveLength(1)
|
||||
|
||||
expect(updatedDependencies[0].name).toEqual('coffee-rails')
|
||||
expect(updatedDependencies[0].type).toEqual('direct:production')
|
||||
expect(updatedDependencies[0].dependencyName).toEqual('coffee-rails')
|
||||
expect(updatedDependencies[0].dependencyType).toEqual('direct:production')
|
||||
expect(updatedDependencies[0].updateType).toEqual('version-update:semver-minor')
|
||||
})
|
||||
|
||||
@@ -61,12 +61,12 @@ test('it supports multiple dependencies within a single fragment', async () => {
|
||||
|
||||
expect(updatedDependencies).toHaveLength(2)
|
||||
|
||||
expect(updatedDependencies[0].name).toEqual('coffee-rails')
|
||||
expect(updatedDependencies[0].type).toEqual('direct:production')
|
||||
expect(updatedDependencies[0].dependencyName).toEqual('coffee-rails')
|
||||
expect(updatedDependencies[0].dependencyType).toEqual('direct:production')
|
||||
expect(updatedDependencies[0].updateType).toEqual('version-update:semver-minor')
|
||||
|
||||
expect(updatedDependencies[1].name).toEqual('coffeescript')
|
||||
expect(updatedDependencies[1].type).toEqual('indirect:production')
|
||||
expect(updatedDependencies[1].dependencyName).toEqual('coffeescript')
|
||||
expect(updatedDependencies[1].dependencyType).toEqual('indirect:production')
|
||||
expect(updatedDependencies[1].updateType).toEqual('version-update:semver-patch')
|
||||
})
|
||||
|
||||
@@ -95,7 +95,7 @@ test('it only returns information within the first fragment if there are multipl
|
||||
|
||||
expect(updatedDependencies).toHaveLength(1)
|
||||
|
||||
expect(updatedDependencies[0].name).toEqual('coffee-rails')
|
||||
expect(updatedDependencies[0].type).toEqual('direct:production')
|
||||
expect(updatedDependencies[0].dependencyName).toEqual('coffee-rails')
|
||||
expect(updatedDependencies[0].dependencyType).toEqual('direct:production')
|
||||
expect(updatedDependencies[0].updateType).toEqual('version-update:semver-minor')
|
||||
})
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as YAML from 'yaml'
|
||||
|
||||
interface updatedDependency {
|
||||
name: string,
|
||||
type: string,
|
||||
dependencyName: string,
|
||||
dependencyType: string,
|
||||
updateType: string,
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ export function parse (commitMessage: string): Array<updatedDependency> {
|
||||
if (data['updated-dependencies']) {
|
||||
return data['updated-dependencies'].map(dependency => {
|
||||
return {
|
||||
name: dependency['dependency-name'],
|
||||
type: dependency['dependency-type'],
|
||||
dependencyName: dependency['dependency-name'],
|
||||
dependencyType: dependency['dependency-type'],
|
||||
updateType: dependency['update-type']
|
||||
}
|
||||
})
|
||||
|
||||
@@ -78,8 +78,8 @@ test('it sets the updated dependencies as an output for subsequent actions', asy
|
||||
'dependabot-updated-dependencies',
|
||||
[
|
||||
{
|
||||
name: 'coffee-rails',
|
||||
type: 'direct:production',
|
||||
dependencyName: 'coffee-rails',
|
||||
dependencyType: 'direct:production',
|
||||
updateType: 'version-update:semver-minor'
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user