From a7593c35c3bf4ed5dcd62699364d1fc2efd60275 Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 9 Jul 2022 01:36:17 +0200 Subject: chore(workflow): add bot-automation.yml (#38) --- .github/workflows/autogenerate.yml | 2 +- .github/workflows/bot-automation.yml | 35 ++++++++++++++++++++++++ .github/workflows/check-generated-code-state.yml | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/bot-automation.yml (limited to '.github') diff --git a/.github/workflows/autogenerate.yml b/.github/workflows/autogenerate.yml index 3c596ca0..03029ebf 100644 --- a/.github/workflows/autogenerate.yml +++ b/.github/workflows/autogenerate.yml @@ -6,7 +6,7 @@ on: - cron: "0 10 * * *" jobs: - run-autogen-script: + autogenerate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/bot-automation.yml b/.github/workflows/bot-automation.yml new file mode 100644 index 00000000..7f11b9ad --- /dev/null +++ b/.github/workflows/bot-automation.yml @@ -0,0 +1,35 @@ +name: Bot automation + +on: + pull_request_review: + types: + - submitted + - edited + +jobs: + make-generate: + if: github.event.sender.login == 'williamboman' && contains(github.event.review.body, '@williambotman /generate') + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + token: ${{ secrets.PAT }} + + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: v0.7.0 + + - name: make generate + run: make generate + + - uses: EndBug/add-and-commit@v9 + with: + author_name: William Botman + author_email: william+bot@redwill.se + message: "chore: run make generate" + push: true diff --git a/.github/workflows/check-generated-code-state.yml b/.github/workflows/check-generated-code-state.yml index e79e14fb..f3b94fea 100644 --- a/.github/workflows/check-generated-code-state.yml +++ b/.github/workflows/check-generated-code-state.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - check: + check-generated-code-state: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 -- cgit v1.2.3-70-g09d2