Skip to content

Commit

Permalink
fix: repair dependabot CI triggers + auto-approve (MystenLabs#4578)
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker authored Sep 12, 2022
1 parent 2fa91f3 commit 0b88006
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs on patch versions
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
Expand All @@ -42,15 +36,22 @@ jobs:
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
# using secrets.AUTOMERGE_TOKEN in the below is key to re-trigger CI
run: |
git config --global user.name 'Francois Garillot'
git config --global user.email 'francois@mystenlabs.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git remote set-url origin https://x-access-token:${{ secrets.AUTOMERGE_TOKEN }}@github.com/${{ github.repository }}
git commit -am "chore(deps): cargo hakari"
git push
- uses: ahmadnassri/action-dependabot-auto-merge@v2.6
with:
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
command: 'squash and merge'
target: minor
- name: Enable auto-merge for Dependabot PRs on patch versions
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 0b88006

Please sign in to comment.