Skip to content

Commit a10d464

Browse files
committed
#369 Enable Docker push for SHA tag
Pushing a Docker image (even for testing purposes) requires respective permissions.
1 parent 3d72f09 commit a10d464

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/build-artifacts.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
secrets:
1818
SONAR_TOKEN:
1919
required: false
20+
GITHUB_TOKEN:
21+
required: true
2022

2123
env:
2224
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION || 'aim42' }}
@@ -25,6 +27,9 @@ env:
2527

2628
jobs:
2729
build:
30+
env:
31+
DOCKER_USERNAME: ${{ github.repository_owner }}
32+
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
2833
runs-on: ubuntu-latest
2934
steps:
3035
- name: Check out

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
with:
2222
# SonarQube requires JDK 17 or higher
2323
java-version: '17'
24+
secrets:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2426

2527
pages:
2628
needs: build-artifacts

.github/workflows/gradle-build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515

1616
jobs:
1717
build-artifacts:
18+
permissions:
19+
packages: write
20+
contents: read
1821
uses: ./.github/workflows/build-artifacts.yml
1922
with:
2023
# SonarQube requires JDK 17 or higher
@@ -23,6 +26,7 @@ jobs:
2326
push-docker-sha: true
2427
secrets:
2528
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2630

2731
test-gh-action:
2832
needs: build-artifacts

.github/workflows/test-java-os-mix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
with:
1414
# SonarQube requires JDK 17 or higher
1515
java-version: '17'
16+
secrets:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1618

1719
test-java-os-mix:
1820
needs: build-artifacts

0 commit comments

Comments
 (0)