Skip to content

Commit

Permalink
feat: Add workflow to update Contributoor dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Jan 13, 2025
1 parent 86650ce commit cf8295d
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/update-contributoor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Update Contributoor

on:
repository_dispatch:
types: [update-contributoor]

permissions:
contents: write

jobs:
update-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: ./.github/workflows/go-setup

- name: Update contributoor dependency
run: |
go get github.com/ethpandaops/contributoor@${{ github.event.client_payload.version }}
go mod tidy
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: update contributoor to ${{ github.event.client_payload.version }}"
title: "chore: update contributoor to ${{ github.event.client_payload.version }}"
branch: update-contributoor-${{ github.event.client_payload.version }}
delete-branch: true
labels: dependencies
body: |
Updates contributoor to ${{ github.event.client_payload.version }}
This PR was automatically created by the contributoor release workflow.
- name: Auto-merge if tests pass
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr merge --auto --merge "${{ steps.cpr.outputs.pull-request-url }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: steps.cpr.outputs.pull-request-operation == 'created'
run: |
# Extract contributoor version without 'v' prefix
VERSION="${{ github.event.client_payload.version }}"
# Create and push tag
git tag "${VERSION}"
git push origin "${VERSION}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit cf8295d

Please sign in to comment.