githubEdit

Why is my GitHub Actions workflow failing with an invalid image tag error?

Context When running a GitHub Actions workflow for deploying a build, you may encounter a failure with an error message indicating an invalid image tag format, such as: "You need to have specific tag for image :[SHA]:latest". Answer This error typically occurs when the workflow is unable to properly fetch and set the image tag due to an expired or invalid GitHub API access token. The workflow uses this token to fetch the latest release tag, which is crucial for running the building and tagging workflow jobs. To resolve this issue: Check your GitHub workflow file (typically .github/workflows/<tenant/env_file>.yml) for a step named "Fetch latest release tag" or something similar. Verify that the GitHub API access token used in the Authorization header is valid: -H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" Generate a new GitHub API access token: Go to GitHub Settings → Developer Settings → Personal Access Tokens Generate a new token with appropriate permissions Update the ACCESS_TOKEN secret in your GitHub repository settings Re-run the workflow after updating the token Note: GitHub API tokens can expire. It's important to periodically review and update your tokens to ensure your workflows continue to function properly.

Last updated

Was this helpful?