Skip to content

Update build_preview.yml #77

Update build_preview.yml

Update build_preview.yml #77

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Time test
# Controls when the workflow will run
on:
push:
branches:
- time_correct
paths:
- ".github/workflows/build_preview.yml"
pull_request:
branches:
- time_correct
paths:
- ".github/workflows/build_preview.yml"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Time GMT+08:00
shell: pwsh
run: |
$NowTime = [int32](Get-Date -UFormat "%s")
$NowTime
$Zone = [int16](Get-Date -UFormat "%Z").ToString()
$Zone
$NeedTime = (8 - $Zone) * 60 * 60
$Result = $NowTime - $NeedTime
$Formated = (Get-Date -UnixTimeSeconds $Result -UFormat "%Y-%m-%d_%H.%M.%S").ToString()
$Formated
"TIME_FORMATTED=$Formated" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Add summary
if: success()
shell: pwsh
run: |
$summary = "时间:${{ env.TIME_FORMATTED }}"
echo $summary >> $Env:GITHUB_STEP_SUMMARY