File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 7070 env :
7171 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7272 run : |
73+ # Get the PR number for the current branch
7374 PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number')
74- PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
75- if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then
76- gh pr review "$PR_NUMBER" --approve
75+
76+ # Check if a PR number was retrieved
77+ if [ -n "$PR_NUMBER" ]; then
78+ # Get the PR author
79+ PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
80+
81+ # Approve the PR if it was not created by the bot
82+ if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then
83+ gh pr review "$PR_NUMBER" --approve
84+ else
85+ echo "PR was created by the bot, skipping review."
86+ fi
7787 else
78- echo "PR was created by the bot, skipping review."
88+ echo "No PR found for the current branch."
89+ fi
You can’t perform that action at this time.
0 commit comments