Syntax fix in PR check.
This commit is contained in:
@@ -25,13 +25,13 @@ jobs:
|
|||||||
id: list-prs
|
id: list-prs
|
||||||
run: |
|
run: |
|
||||||
tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
|
tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
which tea
|
tea login default gitea-rinoa
|
||||||
echo "Check if PR exists for ${{ github.ref_name }}"
|
echo "Checking if PR exists for ${{ github.ref_name }}"
|
||||||
pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $4}' | sed -e 's|"||g')
|
pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $4}' | sed -e 's|"||g')
|
||||||
if [ ${pr_state} != 'open' ]; then
|
if [ "${pr_state}" != 'open' ]; then
|
||||||
echo "PR does not exist, creating..."
|
echo "PR does not exist, creating..."
|
||||||
tea pr c -r ${{ github.repository }} -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}"
|
tea pr c -r "${{ github.repository }}" -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}"
|
||||||
elif [ ${pr_state} = 'open' ]; then
|
elif [ "${pr_state}" = 'open' ]; then
|
||||||
echo "PR already exists, skipping creation..."
|
echo "PR already exists, skipping creation..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user