Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 3, 2025

Changes

This PR adds automated syncing of the README.md and repository description to Docker Hub, ensuring both the full description and short description stay up-to-date whenever Docker images are published.

Implementation

Added a new step to the publish job in .github/workflows/docker.yml that uses the peter-evans/dockerhub-description@v3 action. This step:

  • Runs after the "Build and push image" step
  • Only executes when publishing to Docker Hub (on push to main branch)
  • Uses existing DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets
  • Syncs the ./README.md file to the Docker Hub repository's full description
  • Syncs the GitHub repository description to Docker Hub's short description field
  • Uses dynamic repository reference with ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}

Benefits

  • Eliminates manual README and description updates on Docker Hub
  • Ensures consistency between the GitHub repository and Docker Hub for both full and short descriptions
  • Runs automatically as part of the existing Docker publish workflow

Fixes the issue where Docker Hub descriptions could become outdated when README or repository description changes are made.

- name: Update Docker Hub description + short desc
  uses: peter-evans/dockerhub-description@v3
  with:
    username: ${{ secrets.DOCKERHUB_USERNAME }}
    password: ${{ secrets.DOCKERHUB_TOKEN }}
    repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
    readme-filepath: ./README.md
    short-description: ${{ github.event.repository.description || '' }}

Fixes #9

Original prompt

This section details on the original issue you should resolve

<issue_title>Chore: Update docker.yml workflow</issue_title>
<issue_description>Add to the Docker workflow the following so that the README stays in sync on Docker Hub.

  - name: Update Docker Hub description from README.md
    uses: peter-evans/dockerhub-description@v3
    with:
      username: ${{ secrets.DOCKERHUB_USERNAME }}
      password: ${{ secrets.DOCKERHUB_TOKEN }}
      repository: nickytonline/dev-to-mcp
      readme-filepath: ./README.md
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

Fixes #9

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Chore: Update docker.yml workflow Add Docker Hub README sync to workflow Oct 3, 2025
Copilot AI requested a review from nickytonline October 3, 2025 02:43
Copilot finished work on behalf of nickytonline October 3, 2025 02:43
@nickytonline nickytonline marked this pull request as ready for review October 3, 2025 02:46
Copilot AI review requested due to automatic review settings October 3, 2025 02:46
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

Adds a CI step to automatically sync the repository README to Docker Hub after publishing images, keeping the Docker Hub description up-to-date.

  • Adds peter-evans/dockerhub-description@v3 to the publish workflow
  • Uses Docker Hub credentials from repository secrets and README.md as the source

Copilot AI requested a review from nickytonline October 3, 2025 02:52
Copilot finished work on behalf of nickytonline October 3, 2025 02:52
@nickytonline nickytonline enabled auto-merge (squash) October 3, 2025 02:58
@nickytonline nickytonline disabled auto-merge October 3, 2025 03:01
@nickytonline
Copy link
Owner

@copilot also sync the description, short-description: ${{ github.event.repository.description || '' }}, i.e.

- name: Update Docker Hub description + short desc
  uses: peter-evans/dockerhub-description@v3
  with:
    username: ${{ secrets.DOCKERHUB_USERNAME }}
    password: ${{ secrets.DOCKERHUB_TOKEN }} # this can be a Docker Hub access token
    repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
    readme-filepath: ./README.md
    short-description: ${{ github.event.repository.description || '' }}

auto-merge was automatically disabled October 3, 2025 03:05

Head branch was pushed to by a user without write access

Copy link
Contributor Author

Copilot AI commented Oct 3, 2025

@copilot also sync the description, short-description: ${{ github.event.repository.description || '' }}, i.e.

...

Added the short-description parameter to sync the GitHub repository description to Docker Hub. The step name has also been updated to reflect both syncs. Changes in commit 4086e13.

Copilot AI changed the title Add Docker Hub README sync to workflow Add Docker Hub README and description sync to workflow Oct 3, 2025
Copilot AI requested a review from nickytonline October 3, 2025 03:06
Copilot finished work on behalf of nickytonline October 3, 2025 03:06
@nickytonline nickytonline enabled auto-merge (squash) October 3, 2025 03:06
@nickytonline nickytonline disabled auto-merge October 3, 2025 03:16
@nickytonline nickytonline enabled auto-merge (squash) October 3, 2025 03:17
@nickytonline nickytonline merged commit 52e4e2d into main Oct 3, 2025
2 checks passed
@nickytonline nickytonline deleted the copilot/fix-5be479f2-fd9c-443f-b3ec-9e018ed79667 branch October 3, 2025 03:31
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.

Chore: Update docker.yml workflow

2 participants