Skip to content

Commit

Permalink
ci: test the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
longyulongyu committed Aug 28, 2024
1 parent 43ffcee commit 8001d32
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/check-release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Commit Message

on:
push:
branches:
- trigger-release-build-automatically

jobs:
check-commit-message:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get commit message
id: get_commit_message
run: echo "::set-output name=message::$(git log -1 --pretty=%B)"

- name: Check commit message
run: |
if [[ "${{ steps.get_commit_message.outputs.message }}" == *"[ci] release main"* ]]; then
echo "Commit message contains '[ci] release main', triggering release build..."
echo "::set-output name=trigger_release::true"
else
echo "Error: Commit message must contain '[ci] release main'"
exit 1
id: check_commit_message

trigger-release-build:
needs: check-commit-message
if: needs.check-commit-message.outputs.trigger_release == 'true'
uses: ./release-build-test.yml
19 changes: 19 additions & 0 deletions .github/workflows/release-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Build Test

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Add your build steps here
- name: Build
run: echo "Building the project..."

- name: Release
run: echo "Releasing the project..."

0 comments on commit 8001d32

Please sign in to comment.