devth/yetibot

View on GitHub
.github/workflows/repository-dispatch.yml

Summary

Maintainability
Test Coverage

name: Handle repository dispatch events

# this allows other repos to send a release dispatch here which then triggers a
# version bump
on:
  repository_dispatch:
    types: [bump]
    branches: ["*"]

jobs:
  bump:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.YETIBOT_GITHUB_TOKEN}}

      - uses: DeLaGuardo/setup-clojure@master
        with:
          lein: 2.9.4

      - name: maven cache
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Bump!
        run: |
          git config user.name "$GITHUB_ACTOR"
          git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
          echo "Upgrading to yetibot/core ${{ github.event.client_payload.message.yb_version }}"
          lein update-dependency yetibot/core "${{ github.event.client_payload.message.yb_version }}"

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v3
        with:
          token: ${{ secrets.YETIBOT_GITHUB_TOKEN}}
          commit-message: Bump yetibot/core to "${{ github.event.client_payload.message.yb_version }}"
          title: Bump yetibot/core to "${{ github.event.client_payload.message.yb_version }}"
          branch: yetibot/core-${{ github.event.client_payload.message.yb_version }}