mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-15 12:19:17 +00:00
Update generate-app-headers.yaml
This commit is contained in:
parent
2c4a61d828
commit
cb8372da3d
28
.github/workflows/generate-app-headers.yaml
vendored
28
.github/workflows/generate-app-headers.yaml
vendored
@ -41,20 +41,24 @@ jobs:
|
|||||||
echo ".app-headers already exists."
|
echo ".app-headers already exists."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 4: Compare with main and commit changes
|
# Step 4: Check for changes between main and update-app-headers
|
||||||
- name: Compare with main and commit changes
|
- name: Check if changes are detected
|
||||||
|
id: check_changes
|
||||||
run: |
|
run: |
|
||||||
git fetch origin
|
git fetch origin
|
||||||
DIFF=$(git diff --quiet origin/main..origin/update-app-headers -- .app-headers || echo "Changes detected")
|
git diff --quiet origin/main..HEAD -- .app-headers
|
||||||
if [[ "$DIFF" == "Changes detected" ]]; then
|
echo "Changes detected: $?"
|
||||||
echo "Changes detected in .app-headers. Committing changes."
|
continue-on-error: true # So the workflow continues even if no changes are detected
|
||||||
git commit -am "[core]: update .app-headers to latest version"
|
|
||||||
git push origin update-app-headers --force
|
|
||||||
else
|
|
||||||
echo "No changes in .app-headers. Skipping commit."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Step 5: Create Pull Request if changes detected
|
# Step 5: Commit changes if detected
|
||||||
|
- name: Commit changes if detected
|
||||||
|
if: steps.check_changes.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
echo "Changes detected in .app-headers. Committing changes."
|
||||||
|
git commit -am "[core]: update .app-headers to latest version"
|
||||||
|
git push origin update-app-headers --force
|
||||||
|
|
||||||
|
# Step 6: Create Pull Request if changes detected
|
||||||
- name: Create Pull Request if changes detected
|
- name: Create Pull Request if changes detected
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@ -70,7 +74,7 @@ jobs:
|
|||||||
echo "PR already exists."
|
echo "PR already exists."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 6: Final status output
|
# Step 7: Final status output
|
||||||
- name: Output final status
|
- name: Output final status
|
||||||
run: |
|
run: |
|
||||||
echo "Workflow completed successfully. Branch and PR status updated."
|
echo "Workflow completed successfully. Branch and PR status updated."
|
||||||
|
Loading…
Reference in New Issue
Block a user