ci: allow manual workflow dispatch for optimize templates

This commit is contained in:
Constrat
2024-12-21 15:46:26 +01:00
parent 10bebaaa9c
commit 7df2e92814

View File

@@ -32,15 +32,20 @@ jobs:
- name: Check for direct push
id: check_push
run: |
pr_merge_status=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.event.after }}/pulls" | xargs)
if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then
pr_merge_status=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.event.after }}/pulls" | xargs)
if [[ "$pr_merge_status" == "[ ]" ]]; then
echo "Direct push detected. Proceeding..."
echo "is_pr=False" >> $GITHUB_OUTPUT
if [[ "$pr_merge_status" == "[ ]" ]]; then
echo "Direct push detected. Proceeding..."
echo "is_pr=False" >> $GITHUB_OUTPUT
else
echo "PR merge detected. Exiting."
echo "is_pr=True" >> $GITHUB_OUTPUT
fi
else
echo "PR merge detected. Exiting."
echo "is_pr=True" >> $GITHUB_OUTPUT
echo "Manual trigger detected. Proceeding..."
echo "is_pr=False" >> $GITHUB_OUTPUT
fi
- name: Setup python