Tweaking PR list action.
This commit is contained in:
@@ -15,19 +15,25 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: PR list
|
||||
uses: magebitcom/list-pr-action@v1.0.0
|
||||
id: list-prs
|
||||
with:
|
||||
base: main
|
||||
github-token: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||
state: open
|
||||
|
||||
run: |
|
||||
curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea
|
||||
chmod +x /usr/local/bin/tea
|
||||
echo "Merging PR..."
|
||||
tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}"
|
||||
tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "PR already exists. Skipping PR creation."
|
||||
pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g')
|
||||
echo "pr_index=${pr_index}" >> "$GITHUB_OUTPUT"
|
||||
echo "list_exit=$?" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: List PRs
|
||||
run: |
|
||||
echo "PR count: ${{ steps.list-prs.outputs.pullRequestNumbers }}"
|
||||
|
||||
- name: Create PR
|
||||
if: steps.list-prs.outputs.pr-count == 0
|
||||
if: steps.list-prs.outputs.list_exit != 0
|
||||
uses: arifer612/Gitea-PR-action@v1.2.0
|
||||
with:
|
||||
url: ${{ gitea.server_url }}
|
||||
|
||||
Reference in New Issue
Block a user