chore(update.yml): rename dispatch.yml to update.yml

chore(update.yml): update name from Dispatch to Update
chore(update.yml): update job name from dispatch to update
chore(update.yml): add steps to checkout repository, authorize git, write branch and hash info, commit changes, and push to origin main
chore(update.yml): update notification title from Dispatch to Update
This commit is contained in:
2024-07-01 12:36:28 +07:00
parent 0fd26099c2
commit db0c9a0015

View File

@@ -1,4 +1,4 @@
name: Dispatch name: Update
on: [push, pull_request, workflow_dispatch] on: [push, pull_request, workflow_dispatch]
@@ -76,7 +76,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.PAT }}
dispatch: update:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -85,12 +85,27 @@ jobs:
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
steps: steps:
- name: Dispatch Update Submodule to Gakumas-Localify-EN - name: Checkout
uses: peter-evans/repository-dispatch@v3 uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }} - name: Authorize Git
repository: NatsumeLS/Gakumas-Localify-EN run: |
event-type: update-submodule git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
- name: Write Branch and Hash Info
run: |
branch=$(git rev-parse --abbrev-ref HEAD)
hash=$(git rev-parse --short=7 HEAD)
echo "$branch.$hash" > version.txt
echo "VERSION=$branch.$hash" >> $GITHUB_ENV
- name: Commit Changes
run: |
git commit -am "chore(update): Update Version Info"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Send Notification to Discord - name: Send Notification to Discord
uses: sarisia/actions-status-discord@v1 uses: sarisia/actions-status-discord@v1
@@ -98,4 +113,4 @@ jobs:
with: with:
webhook: ${{ secrets.DISCORD_WEBHOOK }} webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }} status: ${{ job.status }}
title: "Dispatch" title: "Update"