Skip to content

Commit 2640024

Browse files
authored
Use docker/login-action to log in (#61)
Currently the login task is warning that using --password is insecure, and that the credentials are being stored unencrypted. I'm assuming this is out of concern of the password being put on the command line/in runner logs, which should be obfuscated by github, but better safe than sorry.
1 parent 3003593 commit 2640024

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- run: make UBUNTU=${{ matrix.ubuntu-version }} update
2121
- run: make UBUNTU=${{ matrix.ubuntu-version }} build
22-
- run: |
23-
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
24-
make UBUNTU=${{ matrix.ubuntu-version }} push
22+
- name: Log in to docker
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ secrets.DOCKER_USERNAME }}
26+
password: ${{ secrets.DOCKER_PASSWORD }}
27+
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
28+
- run: make UBUNTU=${{ matrix.ubuntu-version }} push
2529
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
2630

2731
build-arm:
@@ -35,9 +39,13 @@ jobs:
3539
- uses: actions/checkout@v4
3640
- run: make DEBIAN=${{ matrix.debian-version }} update/arm
3741
- run: make DEBIAN=${{ matrix.debian-version }} build/arm-base
38-
- run: |
39-
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
40-
make UBUNTU=${{ matrix.debian-version }} push/arm-base
42+
- name: Log in to docker
43+
uses: docker/login-action@v3
44+
with:
45+
username: ${{ secrets.DOCKER_USERNAME }}
46+
password: ${{ secrets.DOCKER_PASSWORD }}
47+
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
48+
- run: make UBUNTU=${{ matrix.debian-version }} push/arm-base
4149
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
4250

4351
build-minimal:
@@ -52,9 +60,13 @@ jobs:
5260
- uses: actions/checkout@v4
5361
- run: make UBUNTU=${{ matrix.ubuntu-version }} update
5462
- run: make UBUNTU=${{ matrix.ubuntu-version }} build/minimal-cross
55-
- run: |
56-
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
57-
make UBUNTU=${{ matrix.ubuntu-version }} push/minimal-cross
63+
- name: Log in to docker
64+
uses: docker/login-action@v3
65+
with:
66+
username: ${{ secrets.DOCKER_USERNAME }}
67+
password: ${{ secrets.DOCKER_PASSWORD }}
68+
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
69+
- run: make UBUNTU=${{ matrix.ubuntu-version }} push/minimal-cross
5870
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
5971

6072
- run: make UBUNTU=${{ matrix.ubuntu-version }} save/minimal-cross
@@ -116,9 +128,12 @@ jobs:
116128
117129
- name: Build image
118130
run: make UBUNTU=${{ matrix.ubuntu-version }} build/cross-${{ matrix.type }}-${{ matrix.pyversion }}
119-
131+
- name: Log in to docker
132+
uses: docker/login-action@v3
133+
with:
134+
username: ${{ secrets.DOCKER_USERNAME }}
135+
password: ${{ secrets.DOCKER_PASSWORD }}
136+
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
120137
- name: Upload image
121-
run: |
122-
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
123-
make UBUNTU=${{ matrix.ubuntu-version }} push/cross-${{ matrix.type }}-${{ matrix.pyversion }}
138+
run: make UBUNTU=${{ matrix.ubuntu-version }} push/cross-${{ matrix.type }}-${{ matrix.pyversion }}
124139
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}

0 commit comments

Comments
 (0)