-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(template): sync with ahmadnassri/template-node-lib
- Loading branch information
Ahmad Nassri
committed
Oct 21, 2021
1 parent
2efd716
commit 882fb31
Showing
1 changed file
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: pull_request_target | |
|
||
name: pull_request_target | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
metadata: | ||
runs-on: ubuntu-latest | ||
|
@@ -27,10 +31,33 @@ jobs: | |
# only run for dependabot PRs | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
steps: | ||
- uses: ahmadnassri/[email protected] | ||
- id: dependabot | ||
uses: dependabot/[email protected] | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: auto merge conditions | ||
id: auto-merge | ||
if: | | ||
( | ||
steps.dependabot.outputs.update-type == 'version-update:semver-patch' && | ||
contains('direct:production,indirect:production', steps.dependabot.outputs.dependency-type) | ||
) || ( | ||
steps.dependabot.outputs.update-type == 'version-update:semver-minor' && | ||
contains('direct:development,indirect:development', steps.dependabot.outputs.dependency-type) | ||
) | ||
run: echo "::notice ::auto-merge conditions satisfied" | ||
|
||
- name: auto approve pr | ||
if: ${{ steps.auto-merge.conclusion == 'success' }} | ||
run: | | ||
gh pr review --approve "$PR_URL" | ||
gh pr merge --auto --rebase "$PR_URL" | ||
template-sync: | ||
needs: metadata | ||
|