cleaned up dependabot auto merge yml w/ burnettk
This commit is contained in:
parent
9de65ea616
commit
e5c806b90a
|
@ -19,6 +19,7 @@ permissions:
|
|||
contents: write
|
||||
|
||||
jobs:
|
||||
# print the context for debugging in case a job gets skipped
|
||||
printJob:
|
||||
name: Print event
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -28,28 +29,13 @@ jobs:
|
|||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: |
|
||||
echo "$GITHUB_CONTEXT"
|
||||
|
||||
dependabot:
|
||||
runs-on: ubuntu-latest
|
||||
# FIXME: uncomment after logging confirms actor is dependabot
|
||||
# if: ${{ github.actor == 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success' }}
|
||||
if: ${{ github.actor == 'dependabot[bot]' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- name: Development Code
|
||||
uses: actions/checkout@v3
|
||||
- name: Log github metadata for debugging
|
||||
# if: ${{contains(steps.metadata.outputs.dependency-names, 'pytest') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
|
||||
# if: ${{contains(steps.metadata.outputs.dependency-names, 'pytest')}}
|
||||
# ideally we auto-merge if all checks pass
|
||||
run: |
|
||||
echo about to log stuff from webhook
|
||||
echo actor: ${{ github.actor }}
|
||||
echo conclusion: ${{ github.event.workflow_run.conclusion }}
|
||||
echo event_name: ${{ github.event_name }}
|
||||
echo pr_url: ${{ github.event.pull_request.html_url }}
|
||||
echo workflow: ${{ github.workflow }}
|
||||
echo and going to next step where it should auto merge
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
###### GET PR NUMBER
|
||||
# we saved the pr_number in tests.yml. fetch it so we can merge the correct PR.
|
||||
|
@ -74,25 +60,13 @@ jobs:
|
|||
});
|
||||
let fs = require('fs');
|
||||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
|
||||
|
||||
- name: 'Unzip artifact'
|
||||
run: unzip pr_number.zip
|
||||
#
|
||||
# - name: Dependabot metadata
|
||||
# id: metadata
|
||||
# uses: dependabot/fetch-metadata@v1.3.1
|
||||
# with:
|
||||
# github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
###########
|
||||
|
||||
- name: print pr number
|
||||
run: cat pr_number
|
||||
- name: actually merge it
|
||||
# if: ${{contains(steps.metadata.outputs.dependency-names, 'pytest') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
|
||||
# if: ${{contains(steps.metadata.outputs.dependency-names, 'pytest')}}
|
||||
# ideally we auto-merge if all checks pass
|
||||
# run: gh pr merge --auto --merge "$PR_URL"
|
||||
run: gh pr merge --auto --merge "$(cat pr_number)"
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
|
Loading…
Reference in New Issue