This is an automated email from the ASF dual-hosted git repository.

sciabarracom pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/openserverless-devcontainer.git


The following commit(s) were added to refs/heads/main by this push:
     new 77498bf  disclaimer
77498bf is described below

commit 77498bf1bedfbeb6e94fdc7e6ed5bec8c9fffd88
Author: Michele Sciabarra <[email protected]>
AuthorDate: Wed Sep 2 22:09:13 2026 +0200

    disclaimer
---
 .github/workflows/DISCLAIMER.md  |  13 ++++
 .github/workflows/disclaimer.yml | 149 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 162 insertions(+)

diff --git a/.github/workflows/DISCLAIMER.md b/.github/workflows/DISCLAIMER.md
new file mode 100644
index 0000000..348e538
--- /dev/null
+++ b/.github/workflows/DISCLAIMER.md
@@ -0,0 +1,13 @@
+ **DISCLAIMER**
+
+ Apache OpenServerless is an effort undergoing incubation at The Apache 
Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is 
required of all newly accepted projects until a further review indicates that 
the infrastructure, communications, and decision making process have
+ stabilized in a manner consistent with other successful ASF projects. While 
incubation status is not necessarily a reflection of the completeness or 
stability of the code, it does indicate that the project has yet to be fully 
endorsed by the ASF.
+
+ **THESE IMAGES ARE NOT APACHE RELEASES**
+
+ The container images published in this repository are convenience artifacts 
built from unreleased source code. They are **not** official Apache 
OpenServerless (incubating) releases: they have not been voted on by the Apache 
OpenServerless PPMC nor approved by the Apache Incubator PMC, and they may 
contain code whose licensing has not been reviewed.
+
+ Apache OpenServerless (incubating) has no approved release yet. When source 
releases become available they will be published at
+ https://downloads.apache.org/incubator/openserverless/ — the source release 
is the only official Apache artifact.
+
+ Use these images at your own risk, for development and evaluation only.
diff --git a/.github/workflows/disclaimer.yml b/.github/workflows/disclaimer.yml
new file mode 100644
index 0000000..2e2e66a
--- /dev/null
+++ b/.github/workflows/disclaimer.yml
@@ -0,0 +1,149 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: Add Disclaimer
+on:
+  workflow_dispatch:
+    inputs:
+      dry_run:
+        description: 'Only show what would be updated (no write)'
+        type: boolean
+        default: true
+      limit:
+        description: 'Max repositories to update (0 = all)'
+        type: string
+        default: '0'
+
+permissions:
+  contents: read
+
+jobs:
+  disclaimer:
+    name: Prepend incubation disclaimer to apache/openserverless-* descriptions
+    runs-on: ubuntu-22.04
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Update descriptions
+        env:
+          DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
+          DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
+          DRY_RUN: ${{ inputs.dry_run }}
+          LIMIT: ${{ inputs.limit }}
+        run: |
+          set -euo pipefail
+
+          DISCLAIMER_FILE=.github/workflows/DISCLAIMER.md
+          MARKER='THESE IMAGES ARE NOT APACHE RELEASES'
+
+          test -f "$DISCLAIMER_FILE"
+
+          # Docker Hub JWT (works with both password and PAT)
+          TOKEN=$(curl -s -H 'Content-Type: application/json' \
+            -d "$(jq -n --arg u "$DOCKERHUB_USER" --arg p "$DOCKERHUB_TOKEN" \
+                  '{username:$u,password:$p}')" \
+            https://hub.docker.com/v2/users/login/ | jq -r '.token // empty')
+
+          if [ -z "$TOKEN" ]; then
+            echo "Docker Hub login failed" >&2
+            exit 1
+          fi
+
+          AUTH=(-H "Authorization: JWT $TOKEN")
+
+          # ---------- 1. discover apache/openserverless-* repositories 
----------
+          REPOS=/tmp/repos.txt
+          : > "$REPOS"
+          URL="https://hub.docker.com/v2/repositories/apache/?page_size=100";
+          while [ -n "$URL" ] && [ "$URL" != "null" ]; do
+            PAGE=$(curl -s "${AUTH[@]}" "$URL")
+            echo "$PAGE" | jq -r '.results[]?.name' >> "$REPOS"
+            URL=$(echo "$PAGE" | jq -r '.next // ""')
+          done
+
+          grep '^openserverless' "$REPOS" | sort -u > /tmp/os_repos.txt || true
+          N_REPOS=$(wc -l < /tmp/os_repos.txt | tr -d ' ')
+
+          echo "found $N_REPOS openserverless repositories"
+          sed 's/^/  /' /tmp/os_repos.txt
+
+          if [ "$N_REPOS" -eq 0 ]; then
+            echo "no apache/openserverless-* repositories found" >&2
+            exit 1
+          fi
+
+          {
+            echo "## Disclaimer report (dry_run=$DRY_RUN, limit=$LIMIT)"
+            echo
+            echo "Found **$N_REPOS** \`apache/openserverless-*\` repositories."
+            echo
+          } >> "$GITHUB_STEP_SUMMARY"
+
+          # ---------- 2. prepend the disclaimer ----------
+          FAILED=0
+          COUNT=0
+          SKIPPED=0
+          while read -r REPO; do
+            [ -z "$REPO" ] && continue
+            if [ "$LIMIT" -gt 0 ] && [ "$COUNT" -ge "$LIMIT" ]; then break; fi
+
+            API="https://hub.docker.com/v2/repositories/apache/$REPO/";
+            CUR=$(curl -s "${AUTH[@]}" "$API" | jq -r '.full_description // 
""')
+
+            # idempotent: never stack the disclaimer twice
+            if printf '%s' "$CUR" | grep -qF "$MARKER"; then
+              SKIPPED=$((SKIPPED + 1))
+              echo "skip $REPO (already has disclaimer)"
+              echo "- :heavy_minus_sign: \`apache/$REPO\` already has the 
disclaimer" >> "$GITHUB_STEP_SUMMARY"
+              continue
+            fi
+
+            COUNT=$((COUNT + 1))
+
+            # disclaimer first, then a blank line, then the existing README
+            NEW=$(cat "$DISCLAIMER_FILE"; printf '\n\n'; printf '%s' "$CUR")
+
+            if [ "$DRY_RUN" = "true" ]; then
+              echo "(dry run) would update $REPO"
+              echo "- (dry run) would update \`apache/$REPO\`" >> 
"$GITHUB_STEP_SUMMARY"
+              continue
+            fi
+
+            BODY=$(jq -n --arg d "$NEW" '{full_description:$d}')
+            CODE=$(curl -s -o /tmp/resp.json -w '%{http_code}' -X PATCH "$API" 
\
+              "${AUTH[@]}" -H 'Content-Type: application/json' -d "$BODY")
+
+            if [ "$CODE" = "200" ]; then
+              echo "updated $REPO"
+              echo "- updated \`apache/$REPO\`" >> "$GITHUB_STEP_SUMMARY"
+            else
+              FAILED=1
+              echo "FAILED $REPO (HTTP $CODE)" >&2
+              head -c 300 /tmp/resp.json >&2 || true
+              echo "- :x: failed \`apache/$REPO\` (HTTP $CODE)" >> 
"$GITHUB_STEP_SUMMARY"
+            fi
+          done < /tmp/os_repos.txt
+
+          echo
+          echo "processed $COUNT, skipped $SKIPPED of $N_REPOS"
+          {
+            echo
+            echo "Processed **$COUNT**, skipped **$SKIPPED** (already had it), 
of **$N_REPOS**."
+          } >> "$GITHUB_STEP_SUMMARY"
+
+          exit $FAILED

Reply via email to