Skip to content

Commit 4b9bd88

Browse files
committed
Drop GHCR_USERNAME and GHCR_PASSWORD
Now that dotnet-s390x has been granted access to the toolchain images [1] [2] [3], GitHub Actions will provide the credentials automatically. [1] https://github.com/orgs/IBM/packages/container/dotnet-ppc64le-toolchain/settings [2] https://github.com/orgs/IBM/packages/container/dotnet-s390x-toolchain/settings [3] https://github.com/orgs/IBM/packages/container/dotnet-x64-toolchain/settings Signed-off-by: Ilya Leoshkevich <[email protected]>
1 parent 35c5559 commit 4b9bd88

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

.github/workflows/dotnet.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- 'v*'
99
pull_request:
1010

11+
permissions:
12+
packages: read
13+
1114
jobs:
1215
runtime:
1316
runs-on: ubuntu-latest
@@ -24,8 +27,8 @@ jobs:
2427
container:
2528
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
2629
credentials:
27-
username: ${{ secrets.GHCR_USERNAME }}
28-
password: ${{ secrets.GHCR_PASSWORD }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
2932
# Workaround for the following:
3033
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
3134
options: --user root
@@ -65,8 +68,8 @@ jobs:
6568
container:
6669
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
6770
credentials:
68-
username: ${{ secrets.GHCR_USERNAME }}
69-
password: ${{ secrets.GHCR_PASSWORD }}
71+
username: ${{ github.actor }}
72+
password: ${{ secrets.GITHUB_TOKEN }}
7073
# Workaround for the following:
7174
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
7275
options: --user root
@@ -110,8 +113,8 @@ jobs:
110113
container:
111114
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
112115
credentials:
113-
username: ${{ secrets.GHCR_USERNAME }}
114-
password: ${{ secrets.GHCR_PASSWORD }}
116+
username: ${{ github.actor }}
117+
password: ${{ secrets.GITHUB_TOKEN }}
115118
# Workaround for the following:
116119
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
117120
options: --user root
@@ -155,8 +158,8 @@ jobs:
155158
container:
156159
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
157160
credentials:
158-
username: ${{ secrets.GHCR_USERNAME }}
159-
password: ${{ secrets.GHCR_PASSWORD }}
161+
username: ${{ github.actor }}
162+
password: ${{ secrets.GITHUB_TOKEN }}
160163
# Workaround for the following:
161164
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
162165
options: --user root
@@ -200,8 +203,8 @@ jobs:
200203
container:
201204
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
202205
credentials:
203-
username: ${{ secrets.GHCR_USERNAME }}
204-
password: ${{ secrets.GHCR_PASSWORD }}
206+
username: ${{ github.actor }}
207+
password: ${{ secrets.GITHUB_TOKEN }}
205208
# Workaround for the following:
206209
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
207210
options: --user root
@@ -245,8 +248,8 @@ jobs:
245248
container:
246249
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
247250
credentials:
248-
username: ${{ secrets.GHCR_USERNAME }}
249-
password: ${{ secrets.GHCR_PASSWORD }}
251+
username: ${{ github.actor }}
252+
password: ${{ secrets.GITHUB_TOKEN }}
250253
# Workaround for the following:
251254
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
252255
options: --user root
@@ -285,8 +288,8 @@ jobs:
285288
container:
286289
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
287290
credentials:
288-
username: ${{ secrets.GHCR_USERNAME }}
289-
password: ${{ secrets.GHCR_PASSWORD }}
291+
username: ${{ github.actor }}
292+
password: ${{ secrets.GITHUB_TOKEN }}
290293
# Workaround for the following:
291294
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
292295
options: --user root

.github/workflows/dotnet.yml.j2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- 'v*'
1313
pull_request:
1414

15+
permissions:
16+
packages: read
17+
1518
{%- set arches = ['ppc64le', 's390x'] -%}
1619

1720
{%- set projects = ['runtime', 'msbuild', 'roslyn', 'sdk', 'aspnetcore', 'installer'] %}
@@ -33,8 +36,8 @@ on:
3336
container:
3437
image: ghcr.io/ibm/dotnet-{% raw %}${{ matrix.arch }}{% endraw %}-toolchain:latest
3538
credentials:
36-
username: {% raw %}${{ secrets.GHCR_USERNAME }}{% endraw %}
37-
password: {% raw %}${{ secrets.GHCR_PASSWORD }}{% endraw %}
39+
username: {% raw %}${{ github.actor }}{% endraw %}
40+
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
3841
# Workaround for the following:
3942
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
4043
options: --user root

.github/workflows/toolchain.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- 'docker/**'
1313
- '.github/workflows/toolchain.yml'
1414

15+
permissions:
16+
packages: write
17+
1518
jobs:
1619
toolchain:
1720
runs-on: ubuntu-latest
@@ -23,8 +26,8 @@ jobs:
2326
- name: Build
2427
run: ARCH=${{ matrix.arch }} docker/build -t ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
2528
- name: Login
26-
run: echo ${{ secrets.GHCR_PASSWORD }} |
27-
docker login ghcr.io --username=${{ secrets.GHCR_USERNAME }} --password-stdin
29+
run: echo ${{ secrets.GITHUB_TOKEN }} |
30+
docker login ghcr.io --username=${{ github.actor }} --password-stdin
2831
if: ${{ github.event_name == 'push' }}
2932
- name: Push
3033
run: docker push ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest

.github/workflows/toolchain.yml.j2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
pull_request:
1919
{{- paths }}
2020

21+
permissions:
22+
packages: write
23+
2124
jobs:
2225
toolchain:
2326
runs-on: ubuntu-latest
@@ -30,8 +33,8 @@ jobs:
3033
- name: Build
3134
run: ARCH={% raw %}${{ matrix.arch }}{% endraw %} docker/build -t {{ image }}
3235
- name: Login
33-
run: echo {% raw %}${{ secrets.GHCR_PASSWORD }}{% endraw %} |
34-
docker login ghcr.io --username={% raw %}${{ secrets.GHCR_USERNAME }}{% endraw %} --password-stdin
36+
run: echo {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} |
37+
docker login ghcr.io --username={% raw %}${{ github.actor }}{% endraw %} --password-stdin
3538
if: {% raw %}${{ github.event_name == 'push' }}{% endraw %}
3639
- name: Push
3740
run: docker push {{ image }}

0 commit comments

Comments
 (0)