Skip to content

fix: exit with code 0 if PR already open #8

fix: exit with code 0 if PR already open

fix: exit with code 0 if PR already open #8

Workflow file for this run

name: Create production promotion pull request
on:
push:
branches:
- 'hotfix/*' # Trigger for hotfix branches
workflow_dispatch:
jobs:
promote-hotfix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |

Check failure on line 14 in .github/workflows/auto-pr.yaml

View workflow run for this annotation

GitHub Actions / Create production promotion pull request

Invalid workflow file

The workflow is not valid. .github/workflows/auto-pr.yaml (Line: 14, Col: 12): Unrecognized named-value: 'prs_list'. Located at position 1 within expression: prs_list != ''
prs_list=$(gh pr list --search "${{ github.ref_name }}")
echo "${prs_list}"
for pr in $prs_list; do
echo ${pr}
done
if: ${{ prs_list != '' }}
then
echo "PR already opened"
exit 0
fi
- name: create pull request
run: gh pr create -B main -H ${{ github.ref_name }} --title 'Merge ${{ github.ref_name }} into main' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.PAT }}