fix: 修复资源更新CI取消条件

This commit is contained in:
MistEO
2023-05-28 15:35:20 +08:00
committed by GitHub
parent 7c1a3aaf50
commit b2d3879108

View File

@@ -78,24 +78,24 @@ jobs:
$commit_msg = "chore: Auto Update Game Resources - $(Get-Date -Format 'yyyy-MM-dd')"
}
git commit -m "$commit_msg"
if ($LASTEXITCODE) {
echo "have_commits=False" >> $env:GITHUB_OUTPUT
if ($LASTEXITCODE -eq 0) {
echo "have_commits=True" >> $env:GITHUB_OUTPUT
}
git pull origin $(git rev-parse --abbrev-ref HEAD) --unshallow --rebase
- name: Cancelling
if: steps.add_files.outputs.have_commits == 'False'
if: steps.add_files.outputs.have_commits != 'True'
uses: andymckay/cancel-action@0.3
- name: Push changes # push the output folder to your repo
if: steps.add_files.outputs.have_commits != 'False'
if: steps.add_files.outputs.have_commits == 'True'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.MISTEOWORKFLOW }}
- name: Release # ref: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
if: steps.add_files.outputs.have_commits != 'False'
if: steps.add_files.outputs.have_commits == 'True'
run: |
gh workflow run release-nightly-ota -f release_body="Auto Release of Resource Updates"
env: