@se-studio/site-check 2.20.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ # Template from @se-studio/site-check (templates/develop-published). Change `develop` below if the site integrates on another branch.
2
+ # Keeps the `develop-published` branch at develop's head. Vercel builds that branch as a preview
3
+ # with DRAFT_ONLY=false (branch-scoped Preview env var), so it serves PUBLISHED Contentful content.
4
+ #
5
+ # develop-published only ever fast-forwards. Nobody edits it, and this job never force-pushes:
6
+ # if develop-published cannot fast-forward to develop, the job fails and nothing is pushed.
7
+ name: Update develop-published
8
+
9
+ on:
10
+ push:
11
+ branches:
12
+ - develop
13
+ workflow_dispatch:
14
+
15
+ permissions:
16
+ contents: write
17
+
18
+ # Runs queue in order; never cancel one mid-push.
19
+ concurrency:
20
+ group: develop-published
21
+ cancel-in-progress: false
22
+
23
+ jobs:
24
+ fast-forward:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ with:
29
+ ref: develop
30
+ fetch-depth: 0
31
+ - name: Fast-forward develop-published to develop
32
+ run: |
33
+ set -euo pipefail
34
+ git fetch --quiet origin develop
35
+ target="$(git rev-parse origin/develop)"
36
+ if git ls-remote --exit-code --heads origin develop-published >/dev/null 2>&1; then
37
+ git fetch --quiet origin develop-published
38
+ current="$(git rev-parse origin/develop-published)"
39
+ if [ "$current" = "$target" ] || git merge-base --is-ancestor "$target" "$current"; then
40
+ echo "develop-published ($current) already contains develop ($target); nothing to do."
41
+ exit 0
42
+ fi
43
+ if ! git merge-base --is-ancestor "$current" "$target"; then
44
+ echo "::error::develop-published ($current) is not an ancestor of develop ($target). It cannot fast-forward. Not pushing. Someone edited develop-published or develop was rewritten: stop and investigate."
45
+ exit 1
46
+ fi
47
+ fi
48
+ # Plain push, no --force: the remote rejects anything that is not a fast-forward.
49
+ git push origin "$target:refs/heads/develop-published"
50
+ echo "develop-published -> $target"
51
+ # Vercel's Git integration does not build a second branch that points at a commit it has already
52
+ # built, so the push above may create no deployment. Trigger the build explicitly, for example with
53
+ # a Vercel deploy hook for ref develop-published (repo secret DEVELOP_PUBLISHED_DEPLOY_HOOK).
54
+ # Left commented: creating the hook is a Vercel project setting that the site owner approves.
55
+ # - name: Trigger the develop-published build
56
+ # env:
57
+ # DEPLOY_HOOK: ${{ secrets.DEVELOP_PUBLISHED_DEPLOY_HOOK }}
58
+ # run: curl -fsS -X POST "$DEPLOY_HOOK"