Update github action for re-tagging #11
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: Auto-retag UNTAGGED entries | |
| # This workflow automatically fixes UNTAGGED entries and commits the changes | |
| # Trigger manually via workflow_dispatch or on push to specific branches | |
| on: | |
| workflow_dispatch: # Manual trigger | |
| push: | |
| branches: | |
| - '**' # All branches | |
| permissions: | |
| contents: write | |
| jobs: | |
| auto-retag: | |
| name: Automatically retag UNTAGGED entries | |
| runs-on: ubuntu-latest | |
| # Only run if there are UNTAGGED entries | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| ref: ${{ github.head_ref || github.ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Run retag script | |
| run: python scripts/retag_untagged.py | |
| - name: Check if file was modified | |
| id: check_changes | |
| run: | | |
| if git diff --quiet IdentityCore/src/telemetry/execution_flow/MSIDExecutionFlowConstants.m; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| echo "No changes made - file already has all tags assigned" | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| echo "Changes detected - UNTAGGED entries were replaced" | |
| fi | |
| - name: Commit and push changes | |
| if: steps.check_changes.outputs.has_changes == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add IdentityCore/src/telemetry/execution_flow/MSIDExecutionFlowConstants.m | |
| git commit -m "Auto-retag UNTAGGED execution flow tags" | |
| git push | |
| - name: No changes needed | |
| if: steps.check_changes.outputs.has_changes == 'false' | |
| run: echo "✓ All tags are already assigned. No action needed." |