Skip to content

Conversation

@NorskNoobing
Copy link

@NorskNoobing NorskNoobing commented Feb 5, 2025

Here's a GitHub action that auto-publishes updates to the README from GitHub to DockerHub. The main action checks if there's a new jotta-cli version compared to the one that's already published to DockerHub. This is done by comparing the string of the DockerHub image tag to the most recent jotta-cli version number.

This requires the DOCKERHUB_USERNAME, and DOCKERHUB_TOKEN repository secrets to be added to the GitHub repo. The username is just the username used for logging into dockerhub, and the token is a personal login token that can be created in the account settings.

Optionally the secret called DOCKER_REPO could also be added if the docker repo- or username doesn't match the GitHub repo- and username. This should then be in the format USERNAME/REPO_NAME.

Solves #18


Important

Adds GitHub Actions to auto-update Docker images and DockerHub README based on jotta-cli version and README.md changes.

  • Workflows:
    • Adds publish-image.yaml to build and push Docker images weekly and on demand.
    • Adds update-dockerhub-readme.yaml to update DockerHub README on README.md changes.
  • Docker Image Update:
    • Compares jotta-cli version with DockerHub image tag in publish-image.yaml.
    • Builds and pushes image if a new version is detected.
    • Tags Git repo with new version.
  • DockerHub README Update:
    • Uses peter-evans/dockerhub-description@v3 to update README on DockerHub.
  • Secrets Required:
    • Requires DOCKERHUB_USERNAME and DOCKERHUB_TOKEN for authentication.
    • Optional DOCKER_REPO secret for custom Docker repository names.

This description was created by Ellipsis for 1f5fd33. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • New Features
    • Automated process now builds, tags, and deploys Docker images on a scheduled and manual basis, ensuring consistent, multi-platform delivery.
    • Repository descriptions on Docker Hub are now automatically updated based on changes to the README.md file, keeping published image information current.

@huly-for-github
Copy link

Connected to Huly®: GHALL-313

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2025

Walkthrough

This pull request introduces two new GitHub Actions workflows in the repository. One workflow automates the process of building, versioning, and pushing a Docker image on a weekly schedule and via manual dispatch. The other workflow updates the Docker Hub repository description when changes are detected in the README file on the main branch. Both workflows utilize environment variables and GitHub secrets for authentication and configuration.

Changes

File(s) Change Summary
.github/workflows/publish-image.yaml New workflow that builds, tags, and pushes a Docker image on a weekly schedule or manual trigger. Includes steps for code checkout, DockerHub login, fetching version data, multi-platform setup, image build, and Git tagging.
.github/workflows/update-dockerhub-readme.yaml New workflow that triggers on README updates to the main branch. It uses an action to update the Docker Hub repository description based on the repository’s README and GitHub event data.

Sequence Diagram(s)

sequenceDiagram
    participant Trigger as Scheduler/Manual
    participant GHAction as GitHub Actions
    participant Repo as Repository Checkout
    participant Docker as DockerHub
    participant Jotta as Jottacloud Repository
    participant Build as Build & Push Process

    Trigger->>GHAction: Trigger workflow (schedule/manual)
    GHAction->>Repo: Checkout repository
    GHAction->>Docker: Log in using secrets
    GHAction->>Jotta: Add repo & fetch jotta-cli version
    GHAction->>GHAction: Retrieve current Docker image version and compare
    GHAction->>Build: Set up QEMU & Buildx, build multi-arch image
    Build->>Docker: Push Docker image
    GHAction->>Repo: Tag Git version and push tag
Loading
sequenceDiagram
    participant Commit as Git Commit
    participant GHAction as GitHub Actions
    participant Docker as DockerHub

    Commit->>GHAction: Push changes to README.md (on main)
    GHAction->>Docker: Run dockerhub-description action
    Docker->>GHAction: Update Docker Hub description
Loading

Poem

I'm a little rabbit hopping with glee,
Seeing workflows run so flawlessly!
Code checks and builds, in a rhythmic beat,
Docker images and tags, oh so neat.
My whiskers twitch for every new feat!
🐇✨
Keep hopping, keep coding, it's a treat!

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 126b28d and d333c0d.

📒 Files selected for processing (1)
  • .github/workflows/update-dockerhub-readme.yaml (1 hunks)
🔇 Additional comments (4)
.github/workflows/update-dockerhub-readme.yaml (4)

1-9: Workflow Triggers and Naming

The workflow is clearly named "Update README on Docker Hub" and is correctly configured to trigger both through manual dispatch (workflow_dispatch) and on pushes that modify the README.md file in the main branch. This meets the PR objective of automating the DockerHub README updates.


10-13: Job Configuration Validation

The update_readme job is well defined with runs-on: ubuntu-latest and a clear delineation of workflow steps. This aligns with best practices for GitHub Actions job setups.


14-15: Repository Checkout Step

The step that checks out the repository using actions/checkout@v4 is implemented correctly. This ensures the workflow has access to the latest code, including the updated README.


16-24: Docker Hub Description Update Step

The step leveraging peter-evans/dockerhub-description@v4 is properly configured:

  • Security: It correctly uses the repository secrets (DOCKERHUB_USERNAME and DOCKERHUB_TOKEN) for authentication.
  • Flexibility: The repository field smartly falls back to github.repository if DOCKER_REPO is not provided, ensuring robustness.
  • Functionality: The readme-filepath and short-description fields are appropriately set to update the Docker Hub repository’s description from the GitHub event data.

Overall, this step is well-aligned with the goal of keeping the DockerHub description in sync with the GitHub README.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 1f5fd33 in 1 minute and 14 seconds

More details
  • Looked at 130 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. .github/workflows/publish-image.yaml:11
  • Draft comment:
    Using '||' for default value may not work as expected. Consider using GitHub Actions’ conditional expressions to assign a default value.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    GitHub Actions does support '||' operator in expressions, but it's true that it can sometimes behave unexpectedly, especially with empty strings vs undefined values. However, in this case, both secrets.DOCKER_REPO and github.repository are well-defined variables in the GitHub Actions context. github.repository will always have a value, making this a safe usage.
    The comment might be pointing to a real issue - empty strings could potentially cause problems with the || operator in some GitHub Actions contexts.
    While the concern is valid in general, this specific usage is safe because github.repository is guaranteed to have a value, making it a reliable fallback.
    The comment should be deleted because this is a safe and common pattern in GitHub Actions, and the fallback is guaranteed to work in this specific case.
2. .github/workflows/update-dockerhub-readme.yaml:18
  • Draft comment:
    The 'repository' field uses github.repository directly. For consistency with the publish workflow, consider using the same DOCKER_REPO value or secret if the DockerHub repo differs.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
  1. This is a new file, so the change is definitely in scope. 2. The comment references another workflow file I can't see. 3. github.repository is a valid GitHub context variable that provides the repository name. 4. Without seeing the other workflow, I can't verify if this consistency suggestion is valid. 5. The current approach using github.repository is technically correct.
    I might be missing important context from the other workflow file that could make this consistency suggestion more important than I think.
    Even if there is another workflow doing things differently, the current approach is valid and working. Making changes for pure consistency without clear benefits isn't a strong enough reason to keep the comment.
    Delete this comment because it's speculative about consistency with unseen code, and the current implementation is technically correct.
3. .github/workflows/update-dockerhub-readme.yaml:18
  • Draft comment:
    The Docker Hub 'repository' is set to '${{ github.repository }}'. If the Docker Hub repo differs from the GitHub repo, consider parameterizing it (as done with DOCKER_REPO in the build workflow) to avoid mismatches.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_UljF40vvF2u89tUa


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@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 (4)
.github/workflows/update-dockerhub-readme.yaml (2)

16-20: Action Inputs Are Sufficient with a Good Opportunity for Enhancement.
The inputs provided—username, password, repository, readme-filepath, and short-description—are correctly configured to update the Docker Hub repository description.

Consider the following improvement for enhanced flexibility:
If the user has configured the optional secret DOCKER_REPO (to override the repository when it differs from GitHub’s default), you might update the repository input to use it when available. For example:

-          repository: ${{ github.repository }}
+          repository: ${{ secrets.DOCKER_REPO != '' ? secrets.DOCKER_REPO : github.repository }}

This change ensures that if DOCKER_REPO is provided, it takes precedence.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

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


20-20: Ensure File Ends with a Newline.
Static analysis indicates that there is no newline character at the end of the file. Please add a newline at the end to adhere to best practices and YAML lint guidelines. For instance:

-          short-description: ${{ github.event.repository.description }}
\ No newline at end of file
+          short-description: ${{ github.event.repository.description }}
+
🧰 Tools
🪛 YAMLlint (1.35.1)

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

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

.github/workflows/publish-image.yaml (2)

48-55: Retrieving Latest Docker Image Version

The command to pull tag names from Docker Hub and exclude the "latest" tag is a clever solution.

  • Using jq, grep, awk, and sort helps extract the desired version.
    Be mindful that tag formats on Docker Hub must remain consistent for this pipeline to work. It may be useful to add error handling in case DOCKER_VERSION ends up empty.

96-96: File Ending Newline

The static analysis tool flagged that the file is missing a newline at the end. Please add a newline character at the end of the file to adhere to best practices and style guidelines.

🧰 Tools
🪛 YAMLlint (1.35.1)

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

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18f862b and 1f5fd33.

📒 Files selected for processing (2)
  • .github/workflows/publish-image.yaml (1 hunks)
  • .github/workflows/update-dockerhub-readme.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/update-dockerhub-readme.yaml

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

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

.github/workflows/publish-image.yaml

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

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

🔇 Additional comments (16)
.github/workflows/update-dockerhub-readme.yaml (3)

1-8: Workflow Trigger Configuration Looks Correct.
The workflow is set to trigger on pushes to the main branch and only when the README.md file changes, which aligns with the PR objectives.


9-12: Job Setup is Configured Properly.
The update_readme job is correctly defined to run on ubuntu-latest, ensuring a current environment for executing the step.


13-15: Step Definition is Clear and Accurate.
The step named "Docker Hub Description" utilizes the peter-evans/dockerhub-description@v3 action as intended. All required keys are introduced starting with the with: block.

.github/workflows/publish-image.yaml (13)

1-2: Descriptive Workflow Name

The workflow name is clear and descriptive, indicating its purpose to build and push the Docker image.


3-7: Correct Trigger Configuration

The schedule and manual dispatch triggers are configured correctly. The cron expression is clear, and having both automated and manual triggers provides flexibility.


8-12: Environment Variable Fallback

The DOCKER_REPO environment variable is set with a fallback to github.repository if the secret is not provided. Verify that the GitHub Actions expression syntax using || works as intended in your context.


13-16: Job Configuration is Clear

The job build is properly configured to run on ubuntu-latest, which is appropriate for Docker operations.


17-21: Repository Checkout Step

Using actions/checkout@v4 ensures that the repository is properly checked out. No issues here.


22-28: DockerHub Login Step

The DockerHub login action is correctly implemented using the provided secrets. Ensure that the secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN are correctly configured in your repository settings.


29-37: Adding the Jottacloud Repository

The step to add the Jottacloud repository is well structured with set -e to fail on errors.

  • The public key is fetched using curl and the repository is added via a tee command.
  • The apt-get update commands before and after adding the repository ensure that package lists are refreshed.
    Consider verifying whether any additional packages (like apt-transport-https) are needed for this repository on your target systems.

38-47: Fetching the Latest jotta-cli Version

The logic to assign the latest version of jotta-cli using apt-cache madison, sorting, and tailing works well.

  • The conditional check for an empty version and subsequent exit is a good safety measure.
    You might also consider outputting errors to stderr for clarity.

56-65: Version Comparison and Early Exit

The version comparison step is straightforward, ensuring that the build only proceeds when an update is needed.

  • If semantic versioning is in use, ensure that string equality is sufficient, or consider a more robust version comparison if needed.

66-73: Setting up QEMU and Buildx

Both the QEMU setup and Buildx steps are correctly implemented, ensuring multi-platform builds. Their versions are up to date.


74-79: Setting the Date Variable for Tagging

Using the date in the yyyyMMdd format to tag the image adds valuable contextual information to the build. The implementation is concise and effective.


80-88: Docker Image Build and Push

This step builds the Docker image for multiple platforms and applies both a latest tag and a version-and-date tag.

  • The use of Docker Buildx supports multi-platform builds effectively.
    Consider verifying that the image tagging follows your versioning conventions, and possibly look into adding build caching if build times become an issue.

89-96: Git Tagging and Push

Tagging the Git repository with the new image version is a useful addition for traceability.

  • The configuration of global Git user settings based on the GitHub actor is neat.
    Ensure that the process handles potential tag conflicts gracefully if a tag already exists.
🧰 Tools
🪛 YAMLlint (1.35.1)

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

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

add no update check, like the code-review bot recommended
* added check and throw error if docker version var is empty. 
* added newline to end of file, like review bot mentioned
Copy link

@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)
.github/workflows/update-dockerhub-readme.yaml (1)

13-15: Remove Trailing Whitespace

There is trailing whitespace detected on line 15. Removing these extra spaces will help adhere to YAML linting guidelines and maintain a clean code style.

Suggested Diff:

-      - name: Checkout repo
-        uses: actions/checkout@v4
-        
+      - name: Checkout repo
+        uses: actions/checkout@v4
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 15-15: trailing spaces

(trailing-spaces)

.github/workflows/publish-image.yaml (1)

48-60: Retrieving Latest Docker Image Version
The step fetches the published Docker image versions from Docker Hub, filters out the "latest" tag, and extracts the version component correctly.
Please remove the trailing spaces on line 59 to adhere to YAML formatting guidelines.

[static_analysis]

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 59-59: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c81db0c and 854a183.

📒 Files selected for processing (2)
  • .github/workflows/publish-image.yaml (1 hunks)
  • .github/workflows/update-dockerhub-readme.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/update-dockerhub-readme.yaml

[error] 15-15: trailing spaces

(trailing-spaces)

.github/workflows/publish-image.yaml

[error] 59-59: trailing spaces

(trailing-spaces)

🔇 Additional comments (15)
.github/workflows/update-dockerhub-readme.yaml (2)

1-8: Workflow Trigger Configuration Looks Good

The trigger is correctly set to run on pushes to the main branch when the README.md file is changed. This ensures that Docker Hub’s repository description stays in sync with repository updates on GitHub.


16-23: Docker Hub Description Step is Configured Properly

The step leveraging the peter-evans/dockerhub-description@v4 action is set up correctly. It makes proper use of the required secrets (DOCKERHUB_USERNAME and DOCKERHUB_TOKEN) and smartly falls back to github.repository when DOCKER_REPO isn’t set. Additionally, passing ./README.md as the readme filepath and using the repository description for a short description aligns well with the intended functionality.

.github/workflows/publish-image.yaml (13)

1-2: Workflow Name is Clearly Defined
The workflow name "Build and Push Docker Image" clearly communicates the purpose of the action.


3-7: Defined Triggers for Scheduled and Manual Dispatch
The workflow is configured to run every Sunday at midnight UTC and also supports manual dispatch, which provides flexibility in execution.


8-12: Environment Variable Configuration
Defining DOCKER_REPO as ${{ secrets.DOCKER_REPO || github.repository }} offers a convenient default to the GitHub repository name while allowing it to be overridden via secrets. Please verify that the logical OR expression works as expected in the GitHub Actions context.


13-21: Job and Checkout Step Setup
The job definition and the use of actions/checkout@v4 are correctly implemented, ensuring that the repository is properly checked out for the build process.


22-28: DockerHub Login Step Review
Logging into DockerHub using docker/login-action@v3 with credentials provided from secrets is implemented appropriately.


29-37: Jottacloud Repository Setup
The step that adds the Jottacloud repository is clear. Using set -e ensures that any command failure will abort the step, which is good for reliability.


38-47: Fetching the Latest jotta-cli Version
The script correctly retrieves the latest version of jotta-cli using apt-cache madison and handles errors when the version is not found.


62-72: Version Comparison Logic
Comparing the current jotta-cli version with the latest Docker image version and setting the NO_UPDATE flag is implemented correctly. This flag is then used to conditionally execute subsequent steps.


73-77: Conditional QEMU Setup
The QEMU setup step is correctly conditioned on the NO_UPDATE flag, ensuring it runs only when a build is necessary.


78-82: Docker Buildx Setup
The conditional configuration for Docker Buildx is properly set, ensuring advanced multi-platform builds are only executed when needed.


83-89: Setting Date Variable for Image Tagging
Using the current date (formatted as yyyyMMdd) to create a version-date composite tag demonstrates good practice for versioning and traceability.


90-98: Docker Image Build and Push Configuration
The build step constructs image tags both as latest and with a detailed version tag and then pushes them to Docker Hub. This dual-tag approach is beneficial for tagging consistency and rollback scenarios.


100-108: Git Repository Tagging and Pushing
Tagging the repository with the new image version and pushing the tag helps maintain version control and provides an audit trail. The use of the GitHub actor details in the configuration is appropriate.

@bluet bluet requested a review from Copilot November 1, 2025 19:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds automated Docker image publishing and README synchronization for a jotta-cli Docker container. It introduces GitHub Actions workflows to automatically detect new jotta-cli versions, build multi-platform Docker images, and keep DockerHub documentation up-to-date.

  • Automated Docker image building triggered weekly or when new jotta-cli versions are detected
  • Multi-platform Docker image support (linux/amd64, linux/arm64/v8) with version-based tagging
  • Automatic DockerHub README synchronization when the repository README.md changes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/publish-image.yaml Main workflow for detecting jotta-cli version changes, building and publishing Docker images with multi-platform support
.github/workflows/update-dockerhub-readme.yaml Workflow to automatically update DockerHub repository description from README.md changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Get latest published Docker image version
run: |
DOCKER_VERSION=$(curl -s "https://registry.hub.docker.com/v2/repositories/${{ env.DOCKER_REPO }}/tags" | \
jq -r '.results[].name' | grep -v '^latest$' | awk -F '-' '{print $1}' | sort -V | tail -n1)
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

The pipeline parsing logic assumes tag format with '-' delimiter but doesn't handle cases where tags might not contain '-'. This could cause awk -F '-' '{print $1}' to fail or return unexpected results for tags without dashes.

Suggested change
jq -r '.results[].name' | grep -v '^latest$' | awk -F '-' '{print $1}' | sort -V | tail -n1)
jq -r '.results[].name' | grep -v '^latest$' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1)

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +57
DOCKER_VERSION=$(curl -s "https://registry.hub.docker.com/v2/repositories/${{ env.DOCKER_REPO }}/tags" | \
jq -r '.results[].name' | grep -v '^latest$' | awk -F '-' '{print $1}' | sort -V | tail -n1)
if [ -z "$DOCKER_VERSION" ]; then
echo "Error: Failed to retrieve latest Docker image version. Exiting."
exit 1
fi
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

The API call doesn't handle pagination. Docker Hub's API returns paginated results, so if there are many tags, the latest version might not be in the first page of results, causing the workflow to miss newer versions.

Copilot uses AI. Check for mistakes.
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.

1 participant