推送图像时GitHub CI解析HTTP 404响应主体 [英] GitHub CI error parsing HTTP 404 response body when pushing the image
问题描述
来自此问题
我正在按照以下给定步骤使用GitHub Actions for Gradle项目:
I am using GitHub Actions for Gradle project with this given steps:
name: Java CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 13
uses: actions/setup-java@v1
with:
java-version: 13
- run: ./gradlew bootJar
- name: Login to Github regestry
run: docker login docker.pkg.github.com -u xxxxx -p xxxxx
- name: Build the Docker image
run: docker build . -t docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.$GITHUB_REF
- name: Push the image to github
run: docker push docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.$GITHUB_REF
在最后一步,我收到此错误:
推送是指存储库 [docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.refs/heads/master]
The push refers to repository [docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.refs/heads/master]
3aad04996f8f:正在准备
3aad04996f8f: Preparing
77cae8ab23bf:正在准备
77cae8ab23bf: Preparing
解析HTTP 404响应正文时出错:顶级值后的无效字符"p": 找不到404页\ n"
error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"
推荐答案
实际上我使用了错误的环境变量来标记我的图像.
actually I was using the wrong environment variable to tag my images.
我使用了 $ GITHUB_REF 我应该使用的 $ GITHUB_SHA
I used $GITHUB_REF what I should use $GITHUB_SHA
这篇关于推送图像时GitHub CI解析HTTP 404响应主体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!