Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use dependabot/fetch-metadata action #276

Merged
merged 12 commits into from Oct 3, 2022
27 changes: 25 additions & 2 deletions action.yml
@@ -1,5 +1,6 @@
name: 'Github Action Merge Dependabot'
description: 'Automatically approve and merge dependabot PRs'

inputs:
github-token:
description: 'A GitHub token'
Expand Down Expand Up @@ -27,9 +28,31 @@ inputs:
pr-number:
description: 'A pull request number, only required if triggered from a workflow_dispatch event'
required: false

runs:
using: 'node16'
main: 'dist/index.js'
using: 'composite'
steps:
- name: Fetch metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
- name: Merge/approve PR
uses: actions/github-script@v6
if: ${{ github.event_name == 'pull_request' }}
guilhermelimak marked this conversation as resolved.
Show resolved Hide resolved
with:
github-token: ${{ inputs.github-token }}
script: |
const script = require('${{ github.action_path }}/dist/index.js')
await script({
github,
context,
inputs: ${{ toJSON(inputs) }}
dependabotMetadata: {
updateType: '${{ steps.dependabot-metadata.outputs.update-type }}'',
dependencyType:'${{ steps.dependabot-metadata.outputs.depedency-type }}'',
dependencyNames: '${{ steps.dependabot-metadata.outputs.depedency-names }}'',
}
})

branding:
icon: 'git-pull-request'
color: 'gray-dark'
315 changes: 0 additions & 315 deletions dist/105.index.js

This file was deleted.