diff --git a/action.yaml b/action.yaml index b553afb..4d02b9d 100644 --- a/action.yaml +++ b/action.yaml @@ -8,10 +8,16 @@ author: 'Jeffery' outputs: version: description: '計算出的新版本號' + value: ${{ steps.calculate.outputs.version }} runs: using: 'docker' image: 'Dockerfile' env: GITEA_SERVER_URL: ${{ gitea.server_url }} GITEA_REPOSITORY: ${{ gitea.repository }} - RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }} \ No newline at end of file + RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }} + using: 'composite' + steps: + - name: 將檔案寫到輸出 + id: calculate + run: echo "VERSION.txt" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 0b467e5..a5bf07e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -70,10 +70,5 @@ PATCH=$((PATCH + 1)) # 組合新的版本號,並顯示 NEW_VERSION="$MAJOR.$MINOR.$PATCH" && echo "NEW_VERSION=$NEW_VERSION" -# 確保 GITHUB_OUTPUT 檔案的目錄存在 -mkdir -p "$(dirname "$GITHUB_OUTPUT")" - # 將版本輸出到環境變數 -echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT - -exit 0 \ No newline at end of file +echo "version=$NEW_VERSION" >> "VERSION.txt" \ No newline at end of file