Update generate-app-headers.yaml

This commit is contained in:
CanbiZ 2025-01-10 13:00:27 +01:00 committed by GitHub
parent bcf981cb33
commit 2e64b89a9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,10 +86,22 @@ jobs:
run: | run: |
git push origin update-app-headers --force || echo "No changes to push" git push origin update-app-headers --force || echo "No changes to push"
# Step 11: Create Pull Request (If changes exist, create a PR) # Step 11: Compare branches (Check for differences between main and update-app-headers)
- name: Compare branches (Check for differences between main and update-app-headers)
run: |
git fetch origin
DIFF=$(git diff --quiet origin/main..origin/update-app-headers || echo "Changes detected")
if [[ "$DIFF" == "Changes detected" ]]; then
echo "Changes found between main and update-app-headers. Proceeding with PR creation."
else
echo "No changes found between main and update-app-headers. Skipping PR creation."
exit 0 # Skip PR creation if no changes are found
fi
# Step 12: Create Pull Request (If changes exist, create a PR)
- name: Create PR - name: Create PR
id: create-pr id: create-pr
if: steps.check-changes.outcome == 'success' if: steps.compare-branches.outcome == 'success'
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
@ -104,23 +116,23 @@ jobs:
echo "PR already exists." echo "PR already exists."
fi fi
# Step 12: Final status (Output status to console) # Step 13: Final status (Output status to console)
- 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."
# Step 13: Post checkout repo (Make sure to clean up the repository state) # Step 14: Post checkout repo (Make sure to clean up the repository state)
- name: Post checkout repo - name: Post checkout repo
run: | run: |
echo "Repository check complete." echo "Repository check complete."
git status git status
# Step 14: Post generate token (Output generated token for logging purposes) # Step 15: Post generate token (Output generated token for logging purposes)
- name: Post generate token - name: Post generate token
run: | run: |
echo "Generated token: ${GITHUB_TOKEN}" echo "Generated token: ${GITHUB_TOKEN}"
# Step 15: Complete (Final confirmation that workflow has finished) # Step 16: Complete (Final confirmation that workflow has finished)
- name: Complete - name: Complete
run: | run: |
echo "Workflow has completed successfully." echo "Workflow has completed successfully."