From 1c40503fc435f4eb52b6ba131fc48aff36d1c734 Mon Sep 17 00:00:00 2001 From: SashaMIT Date: Wed, 5 Aug 2026 20:44:18 +0700 Subject: [PATCH] ci: bind dependabot-tidy inputs via env before shell Move workflow_dispatch/PR context into env: before the Get PR info run script so values are not expanded inside shell. --- .github/workflows/dependabot-tidy.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dependabot-tidy.yml b/.github/workflows/dependabot-tidy.yml index 47dcceb5571..ac4eb292a97 100644 --- a/.github/workflows/dependabot-tidy.yml +++ b/.github/workflows/dependabot-tidy.yml @@ -27,14 +27,18 @@ jobs: id: pr env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EVENT_NAME: ${{ github.event_name }} + PR_NUMBER_INPUT: ${{ inputs.pr_number }} + PR_NUMBER_PR: ${{ github.event.pull_request.number }} + REPOSITORY: ${{ github.repository }} run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - pr_number="${{ inputs.pr_number }}" + if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then + pr_number="$PR_NUMBER_INPUT" else - pr_number="${{ github.event.pull_request.number }}" + pr_number="$PR_NUMBER_PR" fi echo "number=$pr_number" >> $GITHUB_OUTPUT - branch=$(gh pr view "$pr_number" --repo "${{ github.repository }}" --json headRefName -q '.headRefName') + branch=$(gh pr view "$pr_number" --repo "$REPOSITORY" --json headRefName -q '.headRefName') echo "branch=$branch" >> $GITHUB_OUTPUT - uses: actions/checkout@v7 with: