2025-02-12 16:53:19 +01:00
|
|
|
name: Synchronize Project Config
|
|
|
|
on:
|
|
|
|
push:
|
2025-02-20 11:05:47 +01:00
|
|
|
branches-ignore:
|
|
|
|
- "devel"
|
2025-02-12 16:53:19 +01:00
|
|
|
paths:
|
|
|
|
- "_config"
|
2025-02-14 14:36:16 +01:00
|
|
|
- ".gitea/workflows/sync_config.yaml"
|
2025-02-12 16:53:19 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
sync-prjconf:
|
|
|
|
runs-on: tumbleweed
|
|
|
|
steps:
|
|
|
|
- run: |
|
|
|
|
mkdir -p ~/.config/osc
|
2025-02-20 15:57:08 +01:00
|
|
|
cat >~/.config/osc/oscrc <<'EOF'
|
2025-02-12 16:53:19 +01:00
|
|
|
[general]
|
|
|
|
apiurl = https://api.opensuse.org
|
|
|
|
|
|
|
|
[https://api.opensuse.org]
|
2025-02-14 14:40:43 +01:00
|
|
|
user=${{ vars.OBS_USERNAME }}
|
|
|
|
pass=${{ secrets.OBS_PASSWORD }}
|
2025-02-12 16:53:19 +01:00
|
|
|
EOF
|
|
|
|
# Waiting on PR to get merged for support in upstream action/checkout action
|
|
|
|
- uses: 'https://github.com/yangskyboxlabs/action-checkout@sha256'
|
|
|
|
with:
|
|
|
|
object-format: 'sha256'
|
|
|
|
- run: |
|
|
|
|
PROJECT="$(grep PROJECT .obs/common.py | sed 's/PROJECT = "\(.*\)"/\1/')"
|
2025-02-20 11:05:47 +01:00
|
|
|
if [ "$(osc meta prjconf "${PROJECT}" | sha256sum)" != "$(cat _config | sha256sum)" ] ; then
|
2025-02-14 14:34:44 +01:00
|
|
|
osc meta prjconf "${PROJECT}" -F _config
|
|
|
|
fi
|