Skip to content

Commit

Permalink
Merge pull request #25 from chanzuckerberg/alokshin/dependabot-automerge
Browse files Browse the repository at this point in the history
feat: Dependabot auto-merge
  • Loading branch information
alexlokshin-czi authored Sep 22, 2023
2 parents 55af233 + d314a5f commit 2fb4670
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Dependabot auto-merge
on:
pull_request: {}

permissions:
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dependabot-automerge:
runs-on: [ARM64, self-hosted, Linux]
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Generate token
id: generate_token
uses: chanzuckerberg/github-app-token@v1.1.4
with:
app_id: ${{ secrets.CZI_GITHUB_HELPER_APP_ID }}
private_key: ${{ secrets.CZI_GITHUB_HELPER_PK }}
- name: Install gh CLI
shell: bash
env:
VERSION: 2.30.0
run: |
set -ue
set -o pipefail
AMD_URL="https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz"
ARM_URL="https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_arm64.tar.gz"
PLATFORM=$(uname -m)
if [[ $PLATFORM == "arm64" ]]; then
URL=$ARM_URL
elif [[ $PLATFORM == "aarch64" ]]; then
URL=$ARM_URL
else
URL=$AMD_URL
fi
curl $URL -L -v -o ghcli.tar.gz
mkdir ghcli
tar -xf ghcli.tar.gz -C ghcli --strip-components 1
echo "${PWD}/ghcli/bin" >> "${GITHUB_PATH}"
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ steps.generate_token.outputs.token }}"
- name: Approve a PR
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: ${{ steps.generate_token.outputs.token }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This project was initially developed by [Alex Lokshin](https://github.com/alexlo
## Contributing
Contributions and ideas are welcome! Please don't hesitate to open an issue, join our [gitter chat room](https://gitter.im/chanzuckerberg/camelot), or send a pull request.

Go version >= 1.20 required.
Go version >= 1.21 required.

This project is governed under the [Contributor Covenant](https://www.contributor-covenant.org/version/1/4/code-of-conduct) code of conduct.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/chanzuckerberg/camelot

go 1.20
go 1.21

require (
github.com/Masterminds/semver/v3 v3.2.1
Expand Down

0 comments on commit 2fb4670

Please sign in to comment.