Skip to content

Commit

Permalink
chore(ci): add workflow to update ui on repository_dispatch and creat…
Browse files Browse the repository at this point in the history
…e a pr
  • Loading branch information
pcfreak30 committed Nov 1, 2024
1 parent e0e4ac4 commit afc1d9d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/update-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Handle UI Update

on:
repository_dispatch:
types: [update-ui]

jobs:
update-dependency:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.23.0'

- name: Update Go dependency
run: |
COMMIT_HASH="${{ github.event.client_payload.commit_hash }}"
VERSION="${{ github.event.client_payload.version }}"
APP_NAME="${{ github.event.client_payload.app_name }}"
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
# Generate the new version string
NEW_VERSION="v${VERSION}-${APP_NAME}-go.0.${TIMESTAMP}-${COMMIT_HASH}"
# Update the dependency
GOPROXY=off go get "go.lumeweb.com/web/go/${APP_NAME}@${COMMIT_HASH}"
go mod tidy
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update UI dependency to ${{ github.event.client_payload.version }}"
title: "chore: update UI dependency to ${{ github.event.client_payload.version }}"
body: |
Updates UI dependency to latest changes.
Source: ${{ github.event.client_payload.repository }}@${{ github.event.client_payload.commit_hash }}
Version: ${{ github.event.client_payload.version }}
branch: deps/update-ui
base: main
delete-branch: true
labels: |
dependencies
automated pr

0 comments on commit afc1d9d

Please sign in to comment.