diff --git a/.github/workflows/generate-app-headers.yaml b/.github/workflows/generate-app-headers.yaml index 81acca49..26c04e69 100644 --- a/.github/workflows/generate-app-headers.yaml +++ b/.github/workflows/generate-app-headers.yaml @@ -46,11 +46,16 @@ jobs: git checkout update-app-headers fi - # Step 5: Check if there are changes before - - name: Check if there are any changes before making any modifications + # Step 5: Ensure .app-headers file exists (if missing, create it) + - name: Ensure .app-headers file exists run: | - git fetch origin - git diff --exit-code || echo "There are changes to commit." + if [ ! -f ".app-headers" ]; then + echo "The .app-headers file does not exist. Creating it." + touch .app-headers + echo "Generated by CI" > .app-headers + else + echo ".app-headers already exists." + fi # Step 6: Setup Figlet (Install and set up Figlet for text generation) - name: Set up Figlet @@ -61,12 +66,11 @@ jobs: run: | bash .github/workflows/generate-app-headers.sh - # Step 8: Check if changes are available (Check if the app-headers file has been modified) - - name: Check if changes are available - id: check-changes + # Step 8: Check if there are changes + - name: Check for changes run: | git diff --exit-code || echo "Changes detected." - + # Step 9: Commit changes if any - name: Commit changes if any run: | @@ -114,4 +118,4 @@ jobs: # Step 15: Complete (Final confirmation that workflow has finished) - name: Complete run: | - echo "Workflow has completed successfully." +