|
| 1 | +name: Upstream watch |
| 2 | + |
| 3 | +# Opens an issue when internxt/webdav publishes a version tag newer than the |
| 4 | +# one pinned in internxt_webdav/build.yaml (Dependabot can't track that file). |
| 5 | + |
| 6 | +on: |
| 7 | + schedule: |
| 8 | + - cron: "17 6 * * 1" # every Monday morning |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + issues: write |
| 14 | + |
| 15 | +jobs: |
| 16 | + check: |
| 17 | + name: Compare pinned tag with latest upstream |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Check out the repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Check Docker Hub for a newer internxt/webdav tag |
| 24 | + env: |
| 25 | + GH_TOKEN: ${{ github.token }} |
| 26 | + run: | |
| 27 | + pinned=$(sed -n 's|^ amd64:[[:space:]]*internxt/webdav:||p' internxt_webdav/build.yaml) |
| 28 | + latest=$(curl -fsSL "https://hub.docker.com/v2/repositories/internxt/webdav/tags/?page_size=100" \ |
| 29 | + | jq -r '.results[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1) |
| 30 | + echo "pinned=${pinned} latest=${latest}" |
| 31 | +
|
| 32 | + if [ -z "$pinned" ] || [ -z "$latest" ]; then |
| 33 | + echo "::error::Could not determine pinned or latest tag" |
| 34 | + exit 1 |
| 35 | + fi |
| 36 | + if [ "$(printf '%s\n%s\n' "$pinned" "$latest" | sort -V | tail -n1)" = "$pinned" ]; then |
| 37 | + echo "Pinned tag is up to date." |
| 38 | + exit 0 |
| 39 | + fi |
| 40 | +
|
| 41 | + title="Upstream update available: internxt/webdav ${latest}" |
| 42 | + if gh issue list --state open --json title --jq '.[].title' | grep -Fxq "$title"; then |
| 43 | + echo "Issue already open." |
| 44 | + exit 0 |
| 45 | + fi |
| 46 | +
|
| 47 | + body=$(printf '%s\n' \ |
| 48 | + "Upstream published \`internxt/webdav:${latest}\` — the add-on currently pins \`${pinned}\`." \ |
| 49 | + '' \ |
| 50 | + 'Release notes: https://github.com/internxt/cli/releases' \ |
| 51 | + '' \ |
| 52 | + 'Bump checklist:' \ |
| 53 | + '- [ ] Review upstream changes (watch for `login-legacy`, `webdav-config` flags, entrypoint/healthcheck changes — run.sh mirrors the upstream startup sequence)' \ |
| 54 | + '- [ ] Update both arch tags in `internxt_webdav/build.yaml`' \ |
| 55 | + '- [ ] Update the `ARG BUILD_FROM` default in `internxt_webdav/Dockerfile`' \ |
| 56 | + '- [ ] Update the upstream badge in `internxt_webdav/README.md` and the pin mentions in `DOCS.md`' \ |
| 57 | + '- [ ] Test on a real Home Assistant install' \ |
| 58 | + '- [ ] Bump add-on `version` + CHANGELOG entry' \ |
| 59 | + '' \ |
| 60 | + '*Opened automatically by the Upstream watch workflow.*') |
| 61 | + gh label create upstream --color 0e8a16 --description "Upstream Internxt CLI update" --force || true |
| 62 | + gh issue create --title "$title" --label "upstream" --body "$body" |
0 commit comments