Skip to content

fix: use default token for container push workflow#5

Merged
LucianBuzzo merged 1 commit into
masterfrom
lucianbuzzo/use-default-push-token
Nov 11, 2025
Merged

fix: use default token for container push workflow#5
LucianBuzzo merged 1 commit into
masterfrom
lucianbuzzo/use-default-push-token

Conversation

@LucianBuzzo

Copy link
Copy Markdown
Contributor

No description provided.

@LucianBuzzo
LucianBuzzo requested a review from Copilot November 11, 2025 16:18

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a GitHub Actions workflow to automatically publish Docker images to GitHub Container Registry (GHCR) when releases are created. The workflow uses the default GITHUB_TOKEN for authentication, which aligns with GitHub's recommended practices for GHCR authentication.

Key changes:

  • Added automated Docker image publishing triggered on release creation
  • Configured proper permissions for package registry access
  • Implemented semantic versioning with major version and latest tags

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

Comment on lines +21 to +22
VERSION=${GITHUB_REF_NAME#v}
MAJOR=$(echo $VERSION | cut -d. -f1)

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

The version extraction logic doesn't validate the format or handle edge cases. If GITHUB_REF_NAME doesn't start with 'v' or isn't in semver format (e.g., 'v1.2.3'), this will produce unexpected results. Consider adding validation to ensure the ref name matches expected semver pattern before extraction.

Suggested change
VERSION=${GITHUB_REF_NAME#v}
MAJOR=$(echo $VERSION | cut -d. -f1)
# Validate that GITHUB_REF_NAME matches 'vX.Y.Z' where X, Y, Z are numbers
if [[ ! "$GITHUB_REF_NAME" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
echo "Error: GITHUB_REF_NAME ('$GITHUB_REF_NAME') is not in 'vX.Y.Z' semver format."
exit 1
fi
VERSION="${GITHUB_REF_NAME#v}"
MAJOR="$(echo "$VERSION" | cut -d. -f1)"

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +42
ghcr.io/${{ github.repository_owner }}/node-playwright-base-image:${{ env.VERSION }}
ghcr.io/${{ github.repository_owner }}/node-playwright-base-image:${{ env.MAJOR }}
ghcr.io/${{ github.repository_owner }}/node-playwright-base-image:latest No newline at end of file

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

The image name 'node-playwright-base-image' is hardcoded in three places. Consider extracting it to an environment variable at the workflow level to reduce duplication and make future updates easier.

Copilot uses AI. Check for mistakes.
@LucianBuzzo
LucianBuzzo force-pushed the lucianbuzzo/use-default-push-token branch from 4ed9cb1 to edbe975 Compare November 11, 2025 16:19
@LucianBuzzo
LucianBuzzo merged commit e115186 into master Nov 11, 2025
3 checks passed
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