Skip to content

Commit

Permalink
implement auto merging dependabot PR (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutaro-sakamoto authored Dec 4, 2024
1 parent 600f5cd commit ec079a9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,17 @@ jobs:
permissions:
contents: read
uses: ./.github/workflows/server-app.yml

# dependabotが作成したPull Requestを自動マージする
auto-merge-dependabot-pr:
needs: check-workflows
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: gh pr merge "${GITHUB_HEAD_REF}" --merge --squash --auto
14 changes: 9 additions & 5 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ jobs:
deploy:
needs: check-workflows
if: ${{ !contains(github.event.head_commit.message, '[No Deploy]') && !contains(toJson(github.event.commits.*.author.name), 'dependabot') }}
permissions:
id-token: write
contents: read
secrets: inherit
uses: ./.github/workflows/deploy.yml
#dependabotの実験のため、一時的にデプロイを無効
#permissions:
# id-token: write
# contents: read
#secrets: inherit
#uses: ./.github/workflows/deploy.yml
runs-on: ubuntu-latest
steps:
- run: echo hello

# サーバアプリケーションのビルドする
build-server-app:
Expand Down

0 comments on commit ec079a9

Please sign in to comment.