diff --git a/.github/workflows/review_aura_gauge_votes.yaml b/.github/workflows/review_aura_gauge_votes.yaml index 5aac0472c..b4ef3c3f4 100644 --- a/.github/workflows/review_aura_gauge_votes.yaml +++ b/.github/workflows/review_aura_gauge_votes.yaml @@ -4,6 +4,11 @@ on: pull_request: paths: - 'MaxiOps/vlaura_voting/**/input/*.csv' + workflow_dispatch: + inputs: + week-string: + description: "The week to review like YYYY-W##" + required: true jobs: review_votes: @@ -22,21 +27,25 @@ jobs: - name: Determine week-string id: week-string run: | - # Get the path of the changed CSV file - CSV_PATH=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '/input/.*\.csv$' | head -n 1) - - if [ -z "$CSV_PATH" ]; then - echo "No CSV file found in recent changes." - exit 1 - fi + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "week-string=${{ github.event.inputs.week-string }}" >> $GITHUB_OUTPUT + else + # Get the path of the changed CSV file + CSV_PATH=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '/input/.*\.csv$' | head -n 1) + + if [ -z "$CSV_PATH" ]; then + echo "No CSV file found in recent changes." + exit 1 + fi - echo "CSV Path: $CSV_PATH" - - YEAR=$(echo $CSV_PATH | cut -d'/' -f3) - WEEK=$(echo $CSV_PATH | cut -d'/' -f4) - WEEK_STRING="${YEAR}-${WEEK}" + echo "CSV Path: $CSV_PATH" + + YEAR=$(echo $CSV_PATH | cut -d'/' -f3) + WEEK=$(echo $CSV_PATH | cut -d'/' -f4) + WEEK_STRING="${YEAR}-${WEEK}" - echo "week-string=$WEEK_STRING" >> $GITHUB_OUTPUT + echo "week-string=$WEEK_STRING" >> $GITHUB_OUTPUT + fi - name: Review vLAURA Votes run: | @@ -47,6 +56,7 @@ jobs: python3 $RUN_DIR/review_votes.py --week-string "${{ steps.week-string.outputs.week-string }}" - name: Comment PR + if: github.event_name == 'pull_request' uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}}