Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: Build Debian packages

on:
push:
paths-ignore:
- '.github/**'
pull_request:
paths-ignore:
- '.github/**'
workflow_dispatch:

permissions:
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/sync-salsa-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,29 @@ jobs:
https://salsa.debian.org/debian/xymon.git \
master:refs/remotes/salsa/master

- name: Fast-forward GitHub master
- name: Fast-forward GitHub salsa/master
run: |
github_master=$(git ls-remote --heads origin refs/heads/master | cut -f1)
if [ -n "$github_master" ]; then
github_salsa_master=$(
git ls-remote --heads origin refs/heads/salsa/master | cut -f1
)
if [ -n "$github_salsa_master" ]; then
git fetch --no-tags origin \
refs/heads/master:refs/remotes/origin/master
refs/heads/salsa/master:refs/remotes/origin/salsa/master

if ! git merge-base --is-ancestor \
refs/remotes/origin/master refs/remotes/salsa/master; then
refs/remotes/origin/salsa/master refs/remotes/salsa/master; then
printf '%s\n' \
'GitHub master has diverged from Salsa master; refusing to overwrite it.' >&2
'GitHub salsa/master has diverged from Salsa master; refusing to overwrite it.' >&2
exit 1
fi

if [ "$github_master" = \
if [ "$github_salsa_master" = \
"$(git rev-parse refs/remotes/salsa/master)" ]; then
printf '%s\n' 'GitHub master is already synchronized with Salsa master.'
printf '%s\n' 'GitHub salsa/master is already synchronized with Salsa master.'
exit 0
fi
else
printf '%s\n' 'GitHub master does not exist and will be created.'
printf '%s\n' 'GitHub salsa/master does not exist and will be created.'
fi

git push origin refs/remotes/salsa/master:refs/heads/master
git push origin refs/remotes/salsa/master:refs/heads/salsa/master
6 changes: 3 additions & 3 deletions README.podman
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ GitHub Actions
--------------

The Sync master from Salsa workflow is started manually. It creates the GitHub
`master` branch from Debian Salsa on its first run and only fast-forwards it
afterward. The workflow fails without changing the branch if the GitHub and
Salsa histories diverge.
`salsa/master` branch from Debian Salsa's `master` branch on its first run and
only fast-forwards it afterward. The workflow fails without changing the
branch if the GitHub and Salsa histories diverge.

The Build Debian packages workflow runs the same Containerfile and
xymon-testbuild entry point on GitHub-hosted Ubuntu runners. It uses Docker on
Expand Down