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

Automatically merge dependabot PRs #151

Merged
merged 1 commit into from
Jun 14, 2023
Merged

Automatically merge dependabot PRs #151

merged 1 commit into from
Jun 14, 2023

Conversation

kachick
Copy link
Collaborator

@kachick kachick commented Jun 14, 2023

dependabot の PR を auto merge したいということだったので、自分が使ってるやり方のPRを一応出しておきます。
サードパーティのマージアクションとかアプリもあると思うので、他のやり方にするならこのPRは閉じちゃってください。

https://github.com/pankona/pankona.github.com/settings => Allow auto-merge
https://github.com/pankona/pankona.github.com/settings/actions => Allow GitHub Actions to create and approve pull requests

二箇所の設定変更チェックが必要です。(Approve は必須にして無さそうなので、コードから抜いてもいいです)

with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Approve and merge
# if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go の versioning でどうなのかあんまわかっていないながら、一応CI入れたし全部マージで良いのかなーとコメントアウトしておきました

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ただ、現状だと go に絞ってないので github actions の更新もオートマージになります

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全部オートマージでおっけーです (ぶっ壊れたら治すの精神)

run: gh pr review --approve "$PR_URL" && gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
Copy link
Collaborator Author

@kachick kachick Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
GITHUB_TOKEN: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'

こうすると、マージ後にもCI/CDが走ってデプロイまでされる筈
自分はあまりPATを使わないか、https://github.com/tibdex/github-app-token でワンショットのトークン生成させる事が多いのだけれど、このリポジトリにはすでに設定があるし良いと思います。

@kachick kachick changed the title Merge dependabot PRs automatically Automatically merge dependable PRs Jun 14, 2023
@kachick kachick changed the title Automatically merge dependable PRs Automatically merge dependabot PRs Jun 14, 2023
@pankona
Copy link
Owner

pankona commented Jun 14, 2023

記載の通り repository の設定を更新しました!

Copy link
Owner

@pankona pankona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! やっていき

@pankona pankona merged commit d84e463 into pankona:main Jun 14, 2023
@kachick
Copy link
Collaborator Author

kachick commented Jun 14, 2023

🤖 ザマス

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants