-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add workflow to update ui on repository_dispatch and creat…
…e a pr
- Loading branch information
Showing
1 changed file
with
49 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,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 |