mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
add more proper docker login if (#14278)
This commit is contained in:
parent
469246d177
commit
1e02008d8b
1 changed files with 6 additions and 0 deletions
6
.github/workflows/build-docker.yml
vendored
6
.github/workflows/build-docker.yml
vendored
|
@ -45,6 +45,7 @@ jobs:
|
||||||
name: plan
|
name: plan
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
|
login: ${{ steps.plan.outputs.login }}
|
||||||
push: ${{ steps.plan.outputs.push }}
|
push: ${{ steps.plan.outputs.push }}
|
||||||
tag: ${{ steps.plan.outputs.tag }}
|
tag: ${{ steps.plan.outputs.tag }}
|
||||||
action: ${{ steps.plan.outputs.action }}
|
action: ${{ steps.plan.outputs.action }}
|
||||||
|
@ -53,13 +54,16 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DRY_RUN: ${{ inputs.plan == '' || fromJson(inputs.plan).announcement_tag_is_implicit }}
|
DRY_RUN: ${{ inputs.plan == '' || fromJson(inputs.plan).announcement_tag_is_implicit }}
|
||||||
TAG: ${{ inputs.plan != '' && fromJson(inputs.plan).announcement_tag }}
|
TAG: ${{ inputs.plan != '' && fromJson(inputs.plan).announcement_tag }}
|
||||||
|
IS_LOCAL_PR: ${{ github.event.pull_request.head.repo.full_name == 'astral-sh/uv' }}
|
||||||
id: plan
|
id: plan
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ env.DRY_RUN }}" == "false" ]; then
|
if [ "${{ env.DRY_RUN }}" == "false" ]; then
|
||||||
|
echo "login=true" >> "$GITHUB_OUTPUT"
|
||||||
echo "push=true" >> "$GITHUB_OUTPUT"
|
echo "push=true" >> "$GITHUB_OUTPUT"
|
||||||
echo "tag=${{ env.TAG }}" >> "$GITHUB_OUTPUT"
|
echo "tag=${{ env.TAG }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "action=build and publish" >> "$GITHUB_OUTPUT"
|
echo "action=build and publish" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
|
echo "login=${{ env.IS_LOCAL_PR }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "push=false" >> "$GITHUB_OUTPUT"
|
echo "push=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "tag=dry-run" >> "$GITHUB_OUTPUT"
|
echo "tag=dry-run" >> "$GITHUB_OUTPUT"
|
||||||
echo "action=build" >> "$GITHUB_OUTPUT"
|
echo "action=build" >> "$GITHUB_OUTPUT"
|
||||||
|
@ -90,6 +94,7 @@ jobs:
|
||||||
|
|
||||||
# Login to DockerHub (when not pushing, it's to avoid rate-limiting)
|
# Login to DockerHub (when not pushing, it's to avoid rate-limiting)
|
||||||
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||||
|
if: ${{ needs.docker-plan.outputs.login == 'true' }}
|
||||||
with:
|
with:
|
||||||
username: ${{ needs.docker-plan.outputs.push == 'true' && 'astral' || 'astralshbot' }}
|
username: ${{ needs.docker-plan.outputs.push == 'true' && 'astral' || 'astralshbot' }}
|
||||||
password: ${{ needs.docker-plan.outputs.push == 'true' && secrets.DOCKERHUB_TOKEN_RW || secrets.DOCKERHUB_TOKEN_RO }}
|
password: ${{ needs.docker-plan.outputs.push == 'true' && secrets.DOCKERHUB_TOKEN_RW || secrets.DOCKERHUB_TOKEN_RO }}
|
||||||
|
@ -195,6 +200,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
# Login to DockerHub (when not pushing, it's to avoid rate-limiting)
|
# Login to DockerHub (when not pushing, it's to avoid rate-limiting)
|
||||||
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||||
|
if: ${{ needs.docker-plan.outputs.login == 'true' }}
|
||||||
with:
|
with:
|
||||||
username: ${{ needs.docker-plan.outputs.push == 'true' && 'astral' || 'astralshbot' }}
|
username: ${{ needs.docker-plan.outputs.push == 'true' && 'astral' || 'astralshbot' }}
|
||||||
password: ${{ needs.docker-plan.outputs.push == 'true' && secrets.DOCKERHUB_TOKEN_RW || secrets.DOCKERHUB_TOKEN_RO }}
|
password: ${{ needs.docker-plan.outputs.push == 'true' && secrets.DOCKERHUB_TOKEN_RW || secrets.DOCKERHUB_TOKEN_RO }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue