Updated create PR logic.
This commit is contained in:
@@ -14,26 +14,28 @@ jobs:
|
|||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: PR List (Action)
|
- name: Install tea
|
||||||
id: list-prs-action
|
uses: supplypike/setup-bin@v4
|
||||||
uses: andrea-armstrong/github-list-pull-requests@v1.0.0
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
uri: https://dl.gitea.com/tea/main/tea-main-linux-amd64
|
||||||
state: all
|
name: tea
|
||||||
|
version: main
|
||||||
|
|
||||||
|
- name: Install yq
|
||||||
|
uses: dcarbone/install-yq-action@v1
|
||||||
|
|
||||||
|
- 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 default gitea-rinoa
|
||||||
|
|
||||||
- name: PR list
|
- name: PR list
|
||||||
id: list-prs
|
id: list-prs
|
||||||
run: |
|
run: |
|
||||||
pr_check=$(curl ${{ secrets.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} \
|
tea pr ls --state open --output yaml | yq '.[].state'
|
||||||
-X 'GET' \
|
echo "pr_state=$(tea pr ls --state open --output yaml | yq '.[].state')" >> $GITHUB_OUTPUT
|
||||||
-H 'Accept: application/json' \
|
|
||||||
-H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \
|
|
||||||
-sS | jq '{index: .number, state: .state}')
|
|
||||||
echo "PR List: ${pr_check}"
|
|
||||||
pr_state=$(echo ${pr_check} | jq -r '.state')
|
|
||||||
|
|
||||||
- name: Create PR
|
- name: Create PR
|
||||||
if: steps.list-prs-action.outputs.pullRequestNumbers == ''
|
if: steps.list-prs.outputs.pr_state != '"open"'
|
||||||
uses: arifer612/Gitea-PR-action@v1.2.0
|
uses: arifer612/Gitea-PR-action@v1.2.0
|
||||||
with:
|
with:
|
||||||
url: ${{ gitea.server_url }}
|
url: ${{ gitea.server_url }}
|
||||||
@@ -98,8 +100,7 @@ jobs:
|
|||||||
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
||||||
echo "Grabbing subdomains from Cloudflare..."
|
echo "Grabbing subdomains from Cloudflare..."
|
||||||
flarectl --json dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf" | jq '.[].Name' | sed -e 's|"||g' | awk -F"." '{print $1}' | sort > cloudflare_subdomains.txt
|
flarectl --json dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf" | jq '.[].Name' | sed -e 's|"||g' | awk -F"." '{print $1}' | sort > cloudflare_subdomains.txt
|
||||||
readme_list=$(yq '.services | to_entries | map({service: .key, image: .value.image})' docker-compose.yml)
|
yq '.services | to_entries | map({service: .key, image: .value.image})' docker-compose.yml
|
||||||
echo "readme_list=${readme_list}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Compare Subdomains
|
- name: Compare Subdomains
|
||||||
id: compare-subdomains
|
id: compare-subdomains
|
||||||
|
|||||||
Reference in New Issue
Block a user