Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(create-new-release.yml): update client-payload to use github.ref_… #92

Merged
merged 4 commits into from
May 24, 2024

Conversation

mauvehed
Copy link
Owner

@mauvehed mauvehed commented May 24, 2024

…name instead of github.ref to correctly reference the branch name

feat(publish-docker-image.yml): add support for specifying a custom tag when triggering the workflow manually The client-payload in create-new-release.yml is updated to use github.ref_name instead of github.ref to ensure the correct branch name is used. In publish-docker-image.yml, support is added for specifying a custom tag when manually triggering the workflow using workflow_dispatch. This allows users to provide a specific tag for the Docker image build and push process.

…name instead of github.ref to correctly reference the branch name

feat(publish-docker-image.yml): add support for specifying a custom tag when triggering the workflow manually
The client-payload in create-new-release.yml is updated to use github.ref_name instead of github.ref to ensure the correct branch name is used. In publish-docker-image.yml, support is added for specifying a custom tag when manually triggering the workflow using workflow_dispatch. This allows users to provide a specific tag for the Docker image build and push process.
@mauvehed mauvehed added ci Work that improves the continuous integration. github_actions Pull requests that update GitHub Actions code labels May 24, 2024
@mauvehed mauvehed self-assigned this May 24, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @mauvehed - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

tags: ghcr.io/${{ github.repository_owner }}/yourip:nightly
- name: Build and push Docker image
run: |
TAG="${{ github.event.client_payload.tag || github.event.inputs.tag }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Potential issue with tag extraction.

The expression ${{ github.event.client_payload.tag || github.event.inputs.tag }} might not work as expected if github.event.client_payload.tag is an empty string. Consider using a more explicit check.

.github/workflows/publish-docker-image.yml Outdated Show resolved Hide resolved
exit 1
fi

if [ "${TAG}" = "nightly" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Use double brackets for string comparison.

Using double brackets [[ ... ]] for string comparison is generally safer and more robust in shell scripts.

Suggested change
if [ "${TAG}" = "nightly" ]; then
if [[ "${TAG}" == "nightly" ]]; then

mauvehed and others added 3 commits May 24, 2024 12:41
…test image based on the TAG value

The workflow file now includes a conditional statement to build and push a test image to the GitHub Container Registry (GHCR) when the TAG value is set to "test". This enhancement allows for better testing and validation of the application in a separate environment before deploying to production.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…ic for better readability and maintainability

The TAG variable assignment logic has been refactored to improve readability and maintainability. The script now sets the TAG variable based on the event type (repository_dispatch, workflow_dispatch, push) and commit message content. This change makes it easier to understand how the TAG is determined in different scenarios, ensuring consistent behavior across events.
@mauvehed mauvehed enabled auto-merge May 24, 2024 17:45
@mauvehed mauvehed disabled auto-merge May 24, 2024 20:12
@mauvehed mauvehed enabled auto-merge May 24, 2024 20:12
@mauvehed mauvehed disabled auto-merge May 24, 2024 20:12
@mauvehed mauvehed merged commit bcf1e4d into main May 24, 2024
7 checks passed
@mauvehed mauvehed deleted the ci/docker-publish branch May 24, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Work that improves the continuous integration. github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant