Rename output key to updated-dependencies

Thoughts on renaming this and encouraging a specific `id` instead?
This commit is contained in:
Philip Harrison
2021-05-27 11:21:50 +01:00
parent 053e37cc2a
commit 33c0a49593
5 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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
View File

@@ -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.');

View File

@@ -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',

View File

@@ -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.')
}