Fix gitea not supporting if expressions

Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
This commit is contained in:
Nicolas Belouin 2025-02-21 15:38:13 +01:00
parent 4a99805fde
commit 331f08255c

View File

@ -28,18 +28,21 @@ jobs:
- uses: 'https://github.com/yangskyboxlabs/action-checkout@sha256'
with:
object-format: 'sha256'
- if: gitea.event.action == "closed"
run: |
- run: |
if [ "${{ gitea.event.action }}" = "closed" ]; then
PROJECT="$(grep PROJECT .obs/common.py | sed 's/PROJECT = "\(.*\)"/\1/')"
osc rdelete "${PROJECT}:Staging:PR-${{ gitea.event.number }}"
- if: gitea.event.action != "closed"
env:
fi
- env:
SCM_URL: ${{ gitea.event.pull_request.head.repo.clone_url }}#${{ gitea.head_ref }}
run: |
if [ "${{ gitea.event.action }}" != "closed" ]; then
PROJECT="$(grep PROJECT .obs/common.py | sed 's/PROJECT = "\(.*\)"/\1/')"
python3 .obs/render_meta.py --pr ${{ gitea.event.number }} --scm-url "${SCM_URL}" | osc meta prj "${PROJECT}:Staging:PR-${{ gitea.event.number }}" -F -
- if: gitea.event.action != "closed"
run: |
fi
- run: |
if [ "${{ gitea.event.action }}" != "closed" ]; then
PROJECT="$(grep PROJECT .obs/common.py | sed 's/PROJECT = "\(.*\)"/\1/')"
export OBS_PROJECT="${PROJECT}:Staging:PR-${{ gitea.event.number }}"
python3 .obs/wait_obs.py
python3 .obs/wait_obs.py
fi