mirror of
https://github.com/dependabot/fetch-metadata.git
synced 2026-03-13 18:17:13 -04:00
Rename output key to updated-dependencies
Thoughts on renaming this and encouraging a specific `id` instead?
This commit is contained in:
@@ -19,13 +19,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Dependabot metadata
|
||||
id: metadata
|
||||
id: dependabot-metadata
|
||||
uses: dependabot/pull-request-action
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
```
|
||||
|
||||
Subsequent actions will have access to `steps.metadata.outputs.dependabot-updated-dependencies` which will contain a
|
||||
Subsequent actions will have access to `steps.dependabot-metadata.outputs.updated-dependencies` which will contain a
|
||||
JSON object with information about the changes, e.g.
|
||||
|
||||
```json
|
||||
|
||||
@@ -5,7 +5,7 @@ inputs:
|
||||
description: 'The GITHUB_TOKEN secret'
|
||||
required: true
|
||||
outputs:
|
||||
dependabot-updated-dependencies:
|
||||
updated-dependencies:
|
||||
description: 'A JSON serialised hash of any metadata found in verified Dependabot commits in the PR.'
|
||||
runs:
|
||||
using: 'node12'
|
||||
|
||||
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
@@ -12921,8 +12921,8 @@ function run() {
|
||||
core.info('Parsing Dependabot metadata/');
|
||||
const updatedDependencies = parse(commitMessage);
|
||||
if (updatedDependencies.length > 0) {
|
||||
core.info("Outputting metadata to 'dependabot-updated-dependencies'.");
|
||||
core.setOutput('dependabot-updated-dependencies', updatedDependencies);
|
||||
core.info("Outputting metadata to 'updated-dependencies'.");
|
||||
core.setOutput('updated-dependencies', updatedDependencies);
|
||||
}
|
||||
else {
|
||||
core.info('PR does not contain metadata, nothing to do.');
|
||||
|
||||
@@ -75,7 +75,7 @@ test('it sets the updated dependencies as an output for subsequent actions', asy
|
||||
expect.stringContaining('Outputting metadata')
|
||||
)
|
||||
expect(core.setOutput).toHaveBeenCalledWith(
|
||||
'dependabot-updated-dependencies',
|
||||
'updated-dependencies',
|
||||
[
|
||||
{
|
||||
name: 'coffee-rails',
|
||||
|
||||
@@ -27,8 +27,8 @@ export async function run (): Promise<void> {
|
||||
const updatedDependencies = updateMetadata.parse(commitMessage)
|
||||
|
||||
if (updatedDependencies.length > 0) {
|
||||
core.info("Outputting metadata to 'dependabot-updated-dependencies'.")
|
||||
core.setOutput('dependabot-updated-dependencies', updatedDependencies)
|
||||
core.info("Outputting metadata to 'updated-dependencies'.")
|
||||
core.setOutput('updated-dependencies', updatedDependencies)
|
||||
} else {
|
||||
core.info('PR does not contain metadata, nothing to do.')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user