Revert "fix: use multiple -m flags for git commit messages in workflows" #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Delete Web Resume | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| resume_id: | ||
| description: 'Resume ID to delete (e.g., 2025_11_10_company_abc123)' | ||
| required: true | ||
| type: string | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| delete: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Validate input | ||
| run: | | ||
| id="${{ github.event.inputs.resume_id }}" | ||
| if [[ -z "$id" ]]; then | ||
| echo "Error: Resume ID is required" | ||
| exit 1 | ||
| fi | ||
| # Validate format (basic check) | ||
| if [[ ! "$id" =~ ^[0-9]{4}_[0-9]{2}_[0-9]{2}_.+$ ]]; then | ||
| echo "Warning: Resume ID format looks unusual: $id" | ||
| echo "Expected format: YYYY_MM_DD_company_hash" | ||
| echo "Proceeding anyway..." | ||
| fi | ||
| echo "Will delete resume: $id" | ||
| - name: Clone CV-pages repository | ||
| env: | ||
| CV_PAGES_TOKEN: ${{ secrets.CV_PAGES_TOKEN }} | ||
| run: | | ||
| git clone https://x-access-token:${CV_PAGES_TOKEN}@github.com/datarian/CV-pages.git cv-pages-repo | ||
| cd cv-pages-repo | ||
| git checkout gh-pages | ||
| - name: Check if resume exists | ||
| id: check | ||
| run: | | ||
| cd cv-pages-repo | ||
| id="${{ github.event.inputs.resume_id }}" | ||
| target_dir="cv/$id" | ||
| if [ -d "$target_dir" ]; then | ||
| echo "exists=true" >> $GITHUB_OUTPUT | ||
| echo "Resume found at: $target_dir" | ||
| echo "Contents:" | ||
| ls -la "$target_dir" | ||
| else | ||
| echo "exists=false" >> $GITHUB_OUTPUT | ||
| echo "Error: Resume not found at: $target_dir" | ||
| echo "Available resumes:" | ||
| ls -1 cv/ 2>/dev/null || echo "No resumes found" | ||
| exit 1 | ||
| fi | ||
| - name: Delete resume | ||
| if: steps.check.outputs.exists == 'true' | ||
| run: | | ||
| cd cv-pages-repo | ||
| id="${{ github.event.inputs.resume_id }}" | ||
| target_dir="cv/$id" | ||
| echo "Deleting: $target_dir" | ||
| rm -rf "$target_dir" | ||
| # Update manifest if exists | ||
| manifest="cv/.manifest.json" | ||
| if [ -f "$manifest" ]; then | ||
| echo "Updating manifest..." | ||
| # Simple approach: remove entry (would use jq in production) | ||
| # For now, just note that manual cleanup may be needed | ||
| echo "Note: Manifest may need manual cleanup" | ||
| fi | ||
| - name: Commit and push deletion | ||
| if: steps.check.outputs.exists == 'true' | ||
| env: | ||
| CV_PAGES_TOKEN: ${{ secrets.CV_PAGES_TOKEN }} | ||
| run: | | ||
| cd cv-pages-repo | ||
| id="${{ github.event.inputs.resume_id }}" | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "actions@github.com" | ||
| git add . | ||
| git commit -m "$(cat <<'EOF' | ||
| chore: delete web resume $id [skip ci] | ||
| Manually deleted via workflow from datarian/CV. | ||
| 🤖 Triggered by ${{ github.actor }} | ||
| EOF | ||
| )" || echo "No changes to commit" | ||
| git push https://x-access-token:${CV_PAGES_TOKEN}@github.com/datarian/CV-pages.git gh-pages | ||
| - name: Report deletion | ||
| if: steps.check.outputs.exists == 'true' | ||
| run: | | ||
| id="${{ github.event.inputs.resume_id }}" | ||
| echo "## 🗑️ Deletion Complete" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "Deleted resume: **$id**" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "The following URL is now inactive:" >> $GITHUB_STEP_SUMMARY | ||
| echo "- ~~https://datarian.github.io/CV-pages/cv/$id~~" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "Deletion committed to CV-pages repository." >> $GITHUB_STEP_SUMMARY | ||
| - name: List remaining resumes | ||
| if: steps.check.outputs.exists == 'true' | ||
| run: | | ||
| cd cv-pages-repo | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### Remaining Resumes" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| if [ -d "cv" ]; then | ||
| count=$(ls -1 cv/ | grep -v "^\." | grep -v "robots.txt" | wc -l | tr -d ' ') | ||
| echo "Total: $count resume(s)" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| for dir in cv/*/; do | ||
| resume_id=$(basename "$dir") | ||
| if [ "$resume_id" != ".*" ]; then | ||
| echo "- https://datarian.github.io/CV-pages/cv/$resume_id" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
| done | ||
| else | ||
| echo "No resumes remaining." >> $GITHUB_STEP_SUMMARY | ||
| fi | ||