feat: 設定工作流,取得專案 -> 安裝套件 -> 資料庫移轉

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Jeffery
2026-05-06 09:42:50 +08:00
parent 332b13af85
commit d3ce0cd89d
+24 -25
View File
@@ -1,31 +1,30 @@
name: 'Composite Action Template' name: 'DOTNET EF DATABASE MIGRATE'
description: 'Composite Action 範本' description: '.NET EF 資料庫移轉'
author: 'Jeffery' author: 'Jeffery'
inputs: inputs:
runner_token: DOTNET_VERSION:
description: 'Gitea Runner Token' description: '使用的 .NET 版本'
default: '10.0'
PROJECT_NAME:
description: '專案名稱(包含 Microsoft.EntityFrameworkCore.Design 的專案)'
required: true
MIGRATION_PROJECT_NAME:
description: '移轉的專案名稱(包含 DbContext 的專案)'
required: true
MIGRATION_CONTEXT:
description: '移轉的資料庫元件名稱(DbContext 的名稱)'
required: true required: true
text:
description: '輸入的文字'
default: "Hello, World!"
outputs:
text:
description: '輸出的文字'
value: ${{ steps.display.outputs.text }}
runs: runs:
using: 'composite' using: 'composite'
env:
ASPNETCORE_ENVIRONMENT: "Production"
steps: steps:
- name: 顯示資訊 - name: 取得專案
id: display uses: actions/checkout@v6
env: - name: 安裝套件
GITEA_SERVER_URL: ${{ gitea.server_url }} uses: actions/setup-dotnet@v5
GITEA_REPOSITORY: ${{ gitea.repository }} with:
RUNNER_TOKEN: ${{ inputs.runner_token }} dotnet-version: ${{ inputs.DOTNET_VERSION }}
TEXT: ${{ inputs.text }} - name: 資料庫移轉
run: | run: dotnet ef database update --project ../${{ inputs.MIGRATION_PROJECT_NAME }} --context ${{ inputs.MIGRATION_CONTEXT }}
echo "Gitea Server Url: $GITEA_SERVER_URL" working-directory: ${{ inputs.PROJECT_NAME }}
echo "Gitea Repository: $GITEA_REPOSITORY"
echo "Gitea Runner Token: $RUNNER_TOKEN"
echo "Input Text: $TEXT"
echo "text=$TEXT" >> "$GITHUB_OUTPUT"
shell: bash