-
Notifications
You must be signed in to change notification settings - Fork 582
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
{{defaultContext}} is invalid yaml #541
Comments
@deviantintegral Not released yet, you can test with |
@deviantintegral Should be ok now. |
Thanks! I think the docs may be published onto the Marketplace page before the actions are updated, as that's where I originally read about the feature. Regardless, glad this is sorted 🙌 |
I'm having the exact same issue. w/ v2.8.0. It immediately fails and says I have a syntax error, like so:
Here's my entire .yml: name: Build Base Docker Container Image
on: [push]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/base
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Docker Setup Buildx
uses: docker/[email protected]
-
name: Log in to GHCR
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
name: Build and push Docker image
uses: docker/[email protected]
with:
context: {{defaultContext}}:base
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} I'm trying to build a Any guidance? |
So I tried wrapping context in quotes (like so: "{{defaultContext}}:base") and seemed to get further, it seems to be evaluating now, but still failing, now getting:
|
Did I read the README correctly that: |
I also couldn't get this to work using the Git context. As other comments above have noted, it looks like:
This ticket should probably be re-opened. |
Good catch yes, will fix that.
Actually it is if you're using the
|
Troubleshooting
Before submitting a bug report please read the Troubleshooting doc.
Behaviour
I'm trying the new
{{defaultContext}}
variable to build an image in a subdirectory with a git context: https://github.com/marketplace/actions/build-and-push-docker-images#usageHowever, even a basic example throws "You have an error in your yaml syntax". I thought perhaps it needed to be a quoted string, and while that resolves the syntax error the action doesn't replace the template variable.
Steps to reproduce this issue
Expected behaviour
The default string shown in the docs should work.
Configuration
The text was updated successfully, but these errors were encountered: