mirror of
https://github.com/dependabot/fetch-metadata.git
synced 2026-03-15 09:21:00 -04:00
Merge pull request #140 from pangaeatech/fix_name
Renaming `target_branch` to `target-branch`
This commit is contained in:
@@ -41,8 +41,8 @@ Subsequent actions will have access to the following outputs:
|
|||||||
- The `directory` configuration that was used by dependabot for this updated Dependency.
|
- The `directory` configuration that was used by dependabot for this updated Dependency.
|
||||||
- `steps.dependabot-metadata.outputs.package-ecosystem`
|
- `steps.dependabot-metadata.outputs.package-ecosystem`
|
||||||
- The `package-ecosystem` configuration that was used by dependabot for this updated Dependency.
|
- The `package-ecosystem` configuration that was used by dependabot for this updated Dependency.
|
||||||
- `steps.dependabot-metadata.outputs.target_branch`
|
- `steps.dependabot-metadata.outputs.target-branch`
|
||||||
- The `target_branch` configuration that was used by dependabot for this updated Dependency.
|
- The `target-branch` configuration that was used by dependabot for this updated Dependency.
|
||||||
|
|
||||||
**Note:** These outputs will only be populated if the target Pull Request was opened by Dependabot and contains
|
**Note:** These outputs will only be populated if the target Pull Request was opened by Dependabot and contains
|
||||||
**only** Dependabot-created commits.
|
**only** Dependabot-created commits.
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ outputs:
|
|||||||
description: 'The `directory` configuration that was used by dependabot for this updated Dependency.'
|
description: 'The `directory` configuration that was used by dependabot for this updated Dependency.'
|
||||||
package-ecosystem:
|
package-ecosystem:
|
||||||
description: 'The `package-ecosystem` configuration that was used by dependabot for this updated Dependency.'
|
description: 'The `package-ecosystem` configuration that was used by dependabot for this updated Dependency.'
|
||||||
target_branch:
|
target-branch:
|
||||||
description: 'The `target_branch` configuration that was used by dependabot for this updated Dependency.'
|
description: 'The `target-branch` configuration that was used by dependabot for this updated Dependency.'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
@@ -13462,7 +13462,7 @@ function set(updatedDependencies) {
|
|||||||
core.info(`outputs.update-type: ${updateType}`);
|
core.info(`outputs.update-type: ${updateType}`);
|
||||||
core.info(`outputs.directory: ${directory}`);
|
core.info(`outputs.directory: ${directory}`);
|
||||||
core.info(`outputs.package-ecosystem: ${ecosystem}`);
|
core.info(`outputs.package-ecosystem: ${ecosystem}`);
|
||||||
core.info(`outputs.target_branch: ${target}`);
|
core.info(`outputs.target-branch: ${target}`);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
core.setOutput('updated-dependencies-json', updatedDependencies);
|
core.setOutput('updated-dependencies-json', updatedDependencies);
|
||||||
core.setOutput('dependency-names', dependencyNames);
|
core.setOutput('dependency-names', dependencyNames);
|
||||||
@@ -13470,7 +13470,7 @@ function set(updatedDependencies) {
|
|||||||
core.setOutput('update-type', updateType);
|
core.setOutput('update-type', updateType);
|
||||||
core.setOutput('directory', directory);
|
core.setOutput('directory', directory);
|
||||||
core.setOutput('package-ecosystem', ecosystem);
|
core.setOutput('package-ecosystem', ecosystem);
|
||||||
core.setOutput('target_branch', target);
|
core.setOutput('target-branch', target);
|
||||||
}
|
}
|
||||||
function maxDependencyTypes(updatedDependencies) {
|
function maxDependencyTypes(updatedDependencies) {
|
||||||
const dependencyTypes = updatedDependencies.reduce(function (dependencyTypes, dependency) {
|
const dependencyTypes = updatedDependencies.reduce(function (dependencyTypes, dependency) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ test('when given a single dependency it sets its values', async () => {
|
|||||||
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-minor')
|
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-minor')
|
||||||
expect(core.setOutput).toBeCalledWith('directory', 'wwwroot')
|
expect(core.setOutput).toBeCalledWith('directory', 'wwwroot')
|
||||||
expect(core.setOutput).toBeCalledWith('package-ecosystem', 'nuget')
|
expect(core.setOutput).toBeCalledWith('package-ecosystem', 'nuget')
|
||||||
expect(core.setOutput).toBeCalledWith('target_branch', 'main')
|
expect(core.setOutput).toBeCalledWith('target-branch', 'main')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('when given a multiple dependencies, it uses the highest values for types', async () => {
|
test('when given a multiple dependencies, it uses the highest values for types', async () => {
|
||||||
@@ -82,7 +82,7 @@ test('when given a multiple dependencies, it uses the highest values for types',
|
|||||||
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-major')
|
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-major')
|
||||||
expect(core.setOutput).toBeCalledWith('directory', '')
|
expect(core.setOutput).toBeCalledWith('directory', '')
|
||||||
expect(core.setOutput).toBeCalledWith('package-ecosystem', '')
|
expect(core.setOutput).toBeCalledWith('package-ecosystem', '')
|
||||||
expect(core.setOutput).toBeCalledWith('target_branch', '')
|
expect(core.setOutput).toBeCalledWith('target-branch', '')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('when the dependency has no update type', async () => {
|
test('when the dependency has no update type', async () => {
|
||||||
@@ -110,7 +110,7 @@ test('when the dependency has no update type', async () => {
|
|||||||
expect(core.setOutput).toBeCalledWith('update-type', null)
|
expect(core.setOutput).toBeCalledWith('update-type', null)
|
||||||
expect(core.setOutput).toBeCalledWith('directory', '')
|
expect(core.setOutput).toBeCalledWith('directory', '')
|
||||||
expect(core.setOutput).toBeCalledWith('package-ecosystem', '')
|
expect(core.setOutput).toBeCalledWith('package-ecosystem', '')
|
||||||
expect(core.setOutput).toBeCalledWith('target_branch', '')
|
expect(core.setOutput).toBeCalledWith('target-branch', '')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('when given a multiple dependencies, and some do not have update types', async () => {
|
test('when given a multiple dependencies, and some do not have update types', async () => {
|
||||||
@@ -158,5 +158,5 @@ test('when given a multiple dependencies, and some do not have update types', as
|
|||||||
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-minor')
|
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-minor')
|
||||||
expect(core.setOutput).toBeCalledWith('directory', '')
|
expect(core.setOutput).toBeCalledWith('directory', '')
|
||||||
expect(core.setOutput).toBeCalledWith('package-ecosystem', '')
|
expect(core.setOutput).toBeCalledWith('package-ecosystem', '')
|
||||||
expect(core.setOutput).toBeCalledWith('target_branch', '')
|
expect(core.setOutput).toBeCalledWith('target-branch', '')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function set (updatedDependencies: Array<updatedDependency>): void {
|
|||||||
core.info(`outputs.update-type: ${updateType}`)
|
core.info(`outputs.update-type: ${updateType}`)
|
||||||
core.info(`outputs.directory: ${directory}`)
|
core.info(`outputs.directory: ${directory}`)
|
||||||
core.info(`outputs.package-ecosystem: ${ecosystem}`)
|
core.info(`outputs.package-ecosystem: ${ecosystem}`)
|
||||||
core.info(`outputs.target_branch: ${target}`)
|
core.info(`outputs.target-branch: ${target}`)
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
core.setOutput('updated-dependencies-json', updatedDependencies)
|
core.setOutput('updated-dependencies-json', updatedDependencies)
|
||||||
@@ -40,7 +40,7 @@ export function set (updatedDependencies: Array<updatedDependency>): void {
|
|||||||
core.setOutput('update-type', updateType)
|
core.setOutput('update-type', updateType)
|
||||||
core.setOutput('directory', directory)
|
core.setOutput('directory', directory)
|
||||||
core.setOutput('package-ecosystem', ecosystem)
|
core.setOutput('package-ecosystem', ecosystem)
|
||||||
core.setOutput('target_branch', target)
|
core.setOutput('target-branch', target)
|
||||||
}
|
}
|
||||||
|
|
||||||
function maxDependencyTypes (updatedDependencies: Array<updatedDependency>): string {
|
function maxDependencyTypes (updatedDependencies: Array<updatedDependency>): string {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ test('it sets the updated dependency as an output for subsequent actions', async
|
|||||||
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-minor')
|
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-minor')
|
||||||
expect(core.setOutput).toBeCalledWith('directory', '/')
|
expect(core.setOutput).toBeCalledWith('directory', '/')
|
||||||
expect(core.setOutput).toBeCalledWith('package-ecosystem', 'nuget')
|
expect(core.setOutput).toBeCalledWith('package-ecosystem', 'nuget')
|
||||||
expect(core.setOutput).toBeCalledWith('target_branch', 'main')
|
expect(core.setOutput).toBeCalledWith('target-branch', 'main')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('if there are multiple dependencies, it summarizes them', async () => {
|
test('if there are multiple dependencies, it summarizes them', async () => {
|
||||||
@@ -164,7 +164,7 @@ test('if there are multiple dependencies, it summarizes them', async () => {
|
|||||||
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-major')
|
expect(core.setOutput).toBeCalledWith('update-type', 'version-update:semver-major')
|
||||||
expect(core.setOutput).toBeCalledWith('directory', 'api/main')
|
expect(core.setOutput).toBeCalledWith('directory', 'api/main')
|
||||||
expect(core.setOutput).toBeCalledWith('package-ecosystem', 'npm_and_yarn')
|
expect(core.setOutput).toBeCalledWith('package-ecosystem', 'npm_and_yarn')
|
||||||
expect(core.setOutput).toBeCalledWith('target_branch', 'trunk')
|
expect(core.setOutput).toBeCalledWith('target-branch', 'trunk')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('it sets the action to failed if there is an unexpected exception', async () => {
|
test('it sets the action to failed if there is an unexpected exception', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user