-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add workflow to update Contributoor dependency
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |