Skip to content

Conversation

@igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Sep 6, 2025

Summary

This PR adds a script to reliably fetch Armbian kernel package versions (CURRENT and EDGE) from the official beta repository. The script:

  • Imports the Armbian APT signing key into /usr/share/keyrings/armbian.gpg
  • Adds the Armbian beta repository to /etc/apt/sources.list.d/armbian.list
  • Updates package lists
  • Extracts the latest kernel versions using apt-cache madison
  • Outputs the results into a machine-readable kernel-versions.json

Improvements over previous version

  • switch red and green please change color for armbian current and edge release icons community#40
  • Uses curl with gpg --dearmor (avoids temporary files)
  • Works with both Ubuntu (UBUNTU_CODENAME) and Debian (VERSION_CODENAME)
  • Uses apt-cache madison instead of brittle grep/head parsing
  • Strict Bash safety (set -euo pipefail)
  • Produces a clean JSON output
  • Generates SVG files from templates (templates/current-template.svg, templates/edge-template.svg)

Example output

{
  "CURRENT": "6.12.45",
  "EDGE": "6.16.5"
}

Examples of usage:

HTML code on existing places has to be replaced with this one:

SVG

Needs ?random after image to force refresh on browser.

Armbian Linux CURRENT Armbian Linux EDGE

Shields.io

Refreshing is covered by shields.io service parameter.

Armbian Linux CURRENT Armbian Linux EDGE

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • templates/armbian-badge-current.svg is excluded by !**/*.svg
  • templates/armbian-badge-edge.svg is excluded by !**/*.svg

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

  • Renamed a repository_dispatch step and changed its event-type from "Bigin update" to "Repository status" in .github/workflows/generate-jira-excerpt.yml.
  • Modified .github/workflows/generate-motd.yaml: removed the push trigger, renamed the job to "Generate MOTD", and added an active repository_dispatch step that dispatches event-type "Bigin update".
  • Added .github/workflows/repository-status.yaml: new workflow triggered by repository_dispatch "Repository status" that checks out armbian.github.io, queries Armbian APT to extract CURRENT and EDGE kernel package versions, generates two SVG badge files and kernel-versions.json, commits changes to armbian.github.io/data/ if present, and emits a repository_dispatch event-type "MOTD update".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

ready to merge

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch repostatus

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@igorpecovnik igorpecovnik changed the title Extract kernel info from repository Fetch Armbian kernel package versions from beta repository Sep 6, 2025
@igorpecovnik igorpecovnik force-pushed the repostatus branch 8 times, most recently from d40e5bd to 98497e3 Compare September 6, 2025 09:55
@igorpecovnik igorpecovnik marked this pull request as ready for review September 6, 2025 10:09
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (5)
.github/workflows/repository-status.yaml (4)

22-23: Ref to feature branch may break after merge.

ref: repostatus ties the workflow to a short-lived branch. After merge/deletion, templates won’t be available. Prefer default (main) or a stable ref.

-          ref: repostatus
+#         ref: main   # use stable default; or drop to use the workflow’s ref

51-53: Escape sed replacement to handle any special chars.

If versions ever contain & or /, the sed substitution will misbehave. Escape the replacement value.

-          sed "s/{{VERSION}}/$CURRENT/g" armbian.github.io/templates/armbian-badge-current.svg > current.svg
-          sed "s/{{VERSION}}/$EDGE/g"   armbian.github.io/templates/armbian-badge-edge.svg    > edge.svg
+          esc() { printf '%s' "$1" | sed -e 's/[\/&]/\\&/g'; }
+          sed "s/{{VERSION}}/$(esc "$CURRENT")/g" armbian.github.io/templates/armbian-badge-current.svg > current.svg
+          sed "s/{{VERSION}}/$(esc "$EDGE")/g"    armbian.github.io/templates/armbian-badge-edge.svg    > edge.svg

12-15: Job id/name mismatch.

Job id jira is confusing here. Consider renaming for clarity.

-jobs:
-  jira:
+jobs:
+  repository:
     runs-on: ubuntu-24.04
-    name: "Get from Armbian Repository"
+    name: "Get from Armbian Repository"

69-75: YAML lint: trim trailing spaces and add newline at EOF.

Fix the trailing space on Line 70 and ensure the file ends with a newline.

-          git push
- 
+          git push
+
       - name: "Run Bigin update action"
         uses: peter-evans/repository-dispatch@v3
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
           event-type: "MOTD update"
+```
.github/workflows/generate-motd.yaml (1)

48-52: Add newline at EOF.

Satisfy yamllint by ending the file with a newline.

       - name: "Run Bigin update action"
         uses: peter-evans/repository-dispatch@v3
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
-          event-type: "Bigin update"
+          event-type: "Bigin update"
+
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 11fe3e7 and 44e37d2.

⛔ Files ignored due to path filters (4)
  • templates/armbian-badge-current.svg is excluded by !**/*.svg
  • templates/armbian-badge-edge.svg is excluded by !**/*.svg
  • templates/current-template.svg is excluded by !**/*.svg
  • templates/edge-template.svg is excluded by !**/*.svg
📒 Files selected for processing (3)
  • .github/workflows/generate-jira-excerpt.yml (1 hunks)
  • .github/workflows/generate-motd.yaml (2 hunks)
  • .github/workflows/repository-status.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/repository-status.yaml

[error] 70-70: trailing spaces

(trailing-spaces)


[error] 75-75: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/generate-motd.yaml

[error] 52-52: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
.github/workflows/repository-status.yaml (1)

3-5: Trigger scope check.

Including push: will run this workflow on every push, not just on repository_dispatch. Confirm this is intended to avoid unexpected pushes to the data branch.

.github/workflows/generate-jira-excerpt.yml (1)

46-51: Dispatch event rename looks good.

Event type updated to “Repository status” and step name clarified. Matches the new workflow trigger.

.github/workflows/generate-motd.yaml (1)

13-13: LGTM on job rename.

Clearer job name.

igorpecovnik and others added 3 commits September 6, 2025 12:41
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@igorpecovnik
Copy link
Member Author

@coderabbitai generate README.md entry for this action

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# First, let's check if there's an existing README.md and understand its structure
echo "=== Current README.md content ==="
if [ -f README.md ]; then
    cat README.md
else
    echo "No README.md found"
fi

echo -e "\n=== Repository structure ==="
ls -la

echo -e "\n=== Workflow files ==="
ls -la .github/workflows/

echo -e "\n=== New repository-status.yaml workflow content ==="
cat .github/workflows/repository-status.yaml

echo -e "\n=== Template files ==="
ls -la templates/ 2>/dev/null || echo "No templates directory found"

Length of output: 13919


🏁 Script executed:

#!/bin/bash

# Let's examine the template files to understand what they contain
echo "=== Template files content (first few lines) ==="
head -10 templates/armbian-badge-current.svg
echo -e "\n=== Looking for VERSION placeholder in templates ==="
grep -n "{{VERSION}}" templates/armbian-badge-*.svg

echo -e "\n=== Let's also check what's in the data directory structure ==="
ls -la data/ 2>/dev/null || echo "No data directory found in current branch"

echo -e "\n=== Check if there are any existing generated files ==="
find . -name "*.json" -o -name "current.svg" -o -name "edge.svg" 2>/dev/null || echo "No generated files found"

Length of output: 1604


@igorpecovnik I'll generate a README.md entry for the new repository status action. Based on my analysis of the workflow and existing documentation structure, here's the entry to add to your README.md:

- **Fetch Armbian Kernel Package Versions**  
  <a href=https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  
  Fetches latest CURRENT and EDGE kernel package versions from Armbian's beta repository and generates SVG badges and JSON output.  
  [Generated Data →](https://github.armbian.com/kernel-versions.json)

This entry should be placed in the "Metadata & Content Generation" section of your README.md, fitting naturally with the other similar automation workflows.

The workflow:

  1. Imports the Armbian APT signing key and configures the beta repository
  2. Detects the OS release (Ubuntu/Debian) automatically
  3. Queries package versions using apt-cache madison for linux-image-current-x86 and linux-image-edge-x86
  4. Generates SVG badges from templates (templates/armbian-badge-current.svg and templates/armbian-badge-edge.svg) by replacing {{VERSION}} placeholders
  5. Creates JSON output (kernel-versions.json) with the format: {"CURRENT":"6.12.45","EDGE":"6.16.5"}
  6. Commits the generated files to the data branch for public access
  7. Triggers downstream workflows via repository dispatch

The generated files can be used for:

  • HTML integration: <img src="https://github.armbian.com/current.svg" alt="Current kernel version">
  • Shields.io badges: Dynamic JSON endpoint for custom badges
  • API consumption: Machine-readable kernel version data

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
README.md (2)

69-69: Quote the href to satisfy markdownlint MD034 (bare URL).

Quoting the attribute URL avoids the bare-URL warning.

-  <a href=https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  
+  <a href="https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  

68-71: Add a direct link to the generated data for quick access.

A link to kernel-versions.json helps consumers and badge services.

-  Fetches the latest CURRENT and EDGE kernel package versions from Armbian's beta repository and generates SVG badges and a JSON file.  
+  Fetches the latest CURRENT and EDGE kernel package versions from Armbian's beta repository and generates SVG badges and a JSON file.  
+  Data: [kernel-versions.json](https://github.armbian.com/kernel-versions.json)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 44e37d2 and 7610391.

📒 Files selected for processing (2)
  • .github/workflows/repository-status.yaml (1 hunks)
  • README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/repository-status.yaml
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~68-~68: There might be a mistake here.
Context: ... Fetch Armbian Kernel Package Versions <a href=https://github.com/armbian/armbi...

(QB_NEW_EN)


[grammar] ~69-~69: There might be a mistake here.
Context: ...ctions/workflows/repository-status.yaml>GitHub Workflow Status Fetches latest CURRENT and EDGE kernel p...

(QB_NEW_EN)

🪛 markdownlint-cli2 (0.17.2)
README.md

69-69: Bare URL used

(MD034, no-bare-urls)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
README.md (2)

70-71: Add a direct link to the generated JSON for convenience.

Quick-access link helps consumers and matches other entries that link outputs.

Apply:

   Fetches the latest CURRENT and EDGE kernel package versions from Armbian's beta repository and generates SVG badges and a JSON file.  
+
+  [Data →](https://github.armbian.com/kernel-versions.json)

69-69: Quote the href attribute (minor HTML/markdownlint nit).

Quoting improves HTML validity and may quiet MD034 in some setups.

-  <a href=https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  
+  <a href="https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7610391 and 91bc643.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~68-~68: There might be a mistake here.
Context: ... Fetch Armbian Kernel Package Versions <a href=https://github.com/armbian/armbi...

(QB_NEW_EN)


[grammar] ~69-~69: There might be a mistake here.
Context: ...ctions/workflows/repository-status.yaml>GitHub Workflow Status Fetches the latest CURRENT and EDGE kern...

(QB_NEW_EN)

🪛 markdownlint-cli2 (0.17.2)
README.md

69-69: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Get from Armbian Repository
🔇 Additional comments (2)
README.md (2)

68-71: New entry reads well; grammar fix applied.

The description is clear and consistent with the workflow intent.


68-69: No changes required; workflow filename matches badge URL

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
README.md (1)

68-71: LGTM; resolves prior grammar nit.

The sentence now includes “the” and “a JSON file,” addressing the earlier suggestion.

🧹 Nitpick comments (2)
README.md (2)

69-69: Quote the href URL to satisfy MD034 and HTML style.

Use quotes around the href attribute.

-  <a href=https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  
+  <a href="https://github.com/armbian/armbian.github.io/actions/workflows/repository-status.yaml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/repository-status.yaml?logo=githubactions&label=Status&style=for-the-badge&branch=main&logoColor=white"></a>  

70-71: Add a direct link to the published JSON.

Convenience link, mirrors “Docs →/Redirector →” style used elsewhere.

   Fetches the latest CURRENT and EDGE kernel package versions from Armbian's beta repository and generates SVG badges and a JSON file.  
+
+  [Data →](https://github.armbian.com/kernel-versions.json)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 91bc643 and 46883c9.

📒 Files selected for processing (2)
  • .github/workflows/repository-status.yaml (1 hunks)
  • README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/repository-status.yaml
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~68-~68: There might be a mistake here.
Context: ... Fetch Armbian Kernel Package Versions <a href=https://github.com/armbian/armbi...

(QB_NEW_EN)


[grammar] ~69-~69: There might be a mistake here.
Context: ...ctions/workflows/repository-status.yaml>GitHub Workflow Status Fetches the latest CURRENT and EDGE kern...

(QB_NEW_EN)

🪛 markdownlint-cli2 (0.17.2)
README.md

69-69: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Get from Armbian Repository
🔇 Additional comments (1)
README.md (1)

70-70: Confirm scope (x86-only?).

If this workflow queries linux-image-current-x86/edge-x86, consider noting “x86” to avoid ambiguity; otherwise ignore.

@igorpecovnik igorpecovnik merged commit 4a1a6a6 into main Sep 11, 2025
4 checks passed
@igorpecovnik igorpecovnik deleted the repostatus branch September 11, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants