Skip to content

Commit 1ec98e7

Browse files
committed
GHA use docker/login-action for ghcr.io login
1 parent 3fd1f8a commit 1ec98e7

File tree

2 files changed

+40
-24
lines changed

2 files changed

+40
-24
lines changed

.github/workflows/ci-cd-prepare.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,11 @@ jobs:
685685
with:
686686
version: '>= 363.0.0'
687687
- name: Login to Github Container Registry
688-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
689-
env:
690-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
688+
uses: docker/login-action@v3
689+
with:
690+
registry: ghcr.io
691+
username: ${{ github.actor }}
692+
password: ${{ secrets.GITHUB_TOKEN }}
691693

692694
- name: Download utility Docker image
693695
run: ./internal-scripts/ci-cd/download-artifact.sh
@@ -752,9 +754,11 @@ jobs:
752754
with:
753755
version: '>= 363.0.0'
754756
- name: Login to Github Container Registry
755-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
756-
env:
757-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
757+
uses: docker/login-action@v3
758+
with:
759+
registry: ghcr.io
760+
username: ${{ github.actor }}
761+
password: ${{ secrets.GITHUB_TOKEN }}
758762

759763
- name: Download utility Docker image
760764
run: ./internal-scripts/ci-cd/download-artifact.sh
@@ -827,9 +831,11 @@ jobs:
827831
with:
828832
version: '>= 363.0.0'
829833
- name: Login to Github Container Registry
830-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
831-
env:
832-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
834+
uses: docker/login-action@v3
835+
with:
836+
registry: ghcr.io
837+
username: ${{ github.actor }}
838+
password: ${{ secrets.GITHUB_TOKEN }}
833839

834840
- name: Fetch Rbenv source
835841
run: ./internal-scripts/ci-cd/download-artifact.sh
@@ -907,9 +913,11 @@ jobs:
907913
with:
908914
version: '>= 363.0.0'
909915
- name: Login to Github Container Registry
910-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
911-
env:
912-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
916+
uses: docker/login-action@v3
917+
with:
918+
registry: ghcr.io
919+
username: ${{ github.actor }}
920+
password: ${{ secrets.GITHUB_TOKEN }}
913921

914922
- name: Fetch Rbenv source
915923
run: ./internal-scripts/ci-cd/download-artifact.sh

.github/workflows/ci-cd-prepare.yml.erb

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,11 @@ jobs:
284284
with:
285285
version: '>= 363.0.0'
286286
- name: Login to Github Container Registry
287-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
288-
env:
289-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
287+
uses: docker/login-action@v3
288+
with:
289+
registry: ghcr.io
290+
username: ${{ github.actor }}
291+
password: ${{ secrets.GITHUB_TOKEN }}
290292

291293
- name: Download utility Docker image
292294
run: ./internal-scripts/ci-cd/download-artifact.sh
@@ -351,9 +353,11 @@ jobs:
351353
with:
352354
version: '>= 363.0.0'
353355
- name: Login to Github Container Registry
354-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
355-
env:
356-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
356+
uses: docker/login-action@v3
357+
with:
358+
registry: ghcr.io
359+
username: ${{ github.actor }}
360+
password: ${{ secrets.GITHUB_TOKEN }}
357361

358362
- name: Download utility Docker image
359363
run: ./internal-scripts/ci-cd/download-artifact.sh
@@ -426,9 +430,11 @@ jobs:
426430
with:
427431
version: '>= 363.0.0'
428432
- name: Login to Github Container Registry
429-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
430-
env:
431-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
433+
uses: docker/login-action@v3
434+
with:
435+
registry: ghcr.io
436+
username: ${{ github.actor }}
437+
password: ${{ secrets.GITHUB_TOKEN }}
432438

433439
- name: Fetch Rbenv source
434440
run: ./internal-scripts/ci-cd/download-artifact.sh
@@ -506,9 +512,11 @@ jobs:
506512
with:
507513
version: '>= 363.0.0'
508514
- name: Login to Github Container Registry
509-
run: docker login ghcr.io -u ${{ github.actor }} --password-stdin <<<"$GITHUB_TOKEN"
510-
env:
511-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
515+
uses: docker/login-action@v3
516+
with:
517+
registry: ghcr.io
518+
username: ${{ github.actor }}
519+
password: ${{ secrets.GITHUB_TOKEN }}
512520

513521
- name: Fetch Rbenv source
514522
run: ./internal-scripts/ci-cd/download-artifact.sh

0 commit comments

Comments
 (0)