diff --git a/.github/workflows/auto-update-app-headers.yml b/.github/workflows/auto-update-app-headers.yml index dfa34200..0a62c2dd 100644 --- a/.github/workflows/auto-update-app-headers.yml +++ b/.github/workflows/auto-update-app-headers.yml @@ -45,28 +45,26 @@ jobs: # Step 6: Check if there are any changes - name: Check if there are any changes - id: verify-diff run: | echo "Checking for changes..." + git add -A # Untracked Dateien aufnehmen git status - if git diff --quiet; then + if git diff --cached --quiet; then echo "No changes detected." - echo "changed=false" >> $GITHUB_OUTPUT + echo "changed=false" >> "$GITHUB_ENV" else echo "Changes detected:" - git diff --stat - echo "changed=true" >> $GITHUB_OUTPUT + git diff --stat --cached + echo "changed=true" >> "$GITHUB_ENV" fi - # Step 7: Commit changes (if any) and create a PR + # Step 7: Commit and create PR if changes exist - name: Commit and create PR if changes exist - if: steps.verify-diff.outputs.changed == 'true' + if: env.changed == 'true' run: | - git add -A git commit -m "Update .app files" git checkout -b pr-update-app-files git push origin pr-update-app-files --force - gh pr create --title "[core] update .app files" \ --body "This PR is auto-generated by a GitHub Action to update the .app files." \ --head pr-update-app-files \ @@ -77,6 +75,5 @@ jobs: # Step 8: Output success message when no changes - name: No changes detected - if: steps.verify-diff.outputs.changed == 'false' + if: env.changed == 'false' run: echo "No changes to commit. Workflow completed successfully." -