From 33c0a49593153b2da3fdea085dbec6830af4f2c4 Mon Sep 17 00:00:00 2001 From: Philip Harrison Date: Thu, 27 May 2021 11:21:50 +0100 Subject: [PATCH] Rename output key to `updated-dependencies` Thoughts on renaming this and encouraging a specific `id` instead? --- README.md | 4 ++-- action.yml | 2 +- dist/index.js | 4 ++-- src/main.test.ts | 2 +- src/main.ts | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 832edbd..7d00b66 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 1849377..42e27a9 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/dist/index.js b/dist/index.js index 4a484ce..7f4744b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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.'); diff --git a/src/main.test.ts b/src/main.test.ts index a6411c4..e93d461 100644 --- a/src/main.test.ts +++ b/src/main.test.ts @@ -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', diff --git a/src/main.ts b/src/main.ts index c936bef..c233069 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,8 +27,8 @@ export async function run (): Promise { 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.') }