Skip to content

Commit 4bb83d2

Browse files
authored
chire: fix workflow permission (#680)
Co-authored-by: Christian Lechner <22294087+lechnerc77@users.noreply.github.com>
1 parent ec24a73 commit 4bb83d2

14 files changed

Lines changed: 114 additions & 80 deletions

.github/workflows/build-and-publish-api-mssql-go.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ env:
77
IMAGE_NAME: api-mssql-go
88
LABEL: 1.0.0
99

10+
permissions:
11+
contents: read
12+
packages: write
13+
1014
jobs:
1115
build_and_push:
1216
runs-on: ubuntu-latest
@@ -29,7 +33,7 @@ jobs:
2933
- name: Build and push Docker image
3034
uses: docker/build-push-action@v3.1.0
3135
with:
32-
context: "{{defaultContext}}:dsagtt22/ordermicroservice/api-mssql-go"
36+
context: "{{defaultContext}}:dsagtt22/ordermicroservice/api-mssql-go"
3337
push: true
3438
tags: ${{ steps.meta.outputs.tags }}
35-
labels: ${{ steps.meta.outputs.labels }}
39+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-and-publish-custom-component-dapr.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010
IMAGE_NAME: daprwishlistapp
1111
LABEL: 1.0.0
1212

13+
permissions:
14+
contents: read
15+
packages: write
16+
1317
jobs:
1418
build_and_push:
1519
runs-on: ubuntu-latest
@@ -23,13 +27,13 @@ jobs:
2327
uses: actions/setup-node@v3
2428
with:
2529
node-version: 16
26-
- name: 'Install dependencies and Build'
30+
- name: "Install dependencies and Build"
2731
shell: bash
2832
run: |
2933
pushd './custom-component-dapr'
3034
npm ci
3135
npm run build
32-
popd
36+
popd
3337
- name: Log in to the Container registry (GH Packages)
3438
uses: docker/login-action@v2
3539
with:
@@ -49,4 +53,4 @@ jobs:
4953
context: ./${{ env.SUBDIRECTORY }}
5054
push: true
5155
tags: ${{ steps.meta.outputs.tags }}
52-
labels: ${{ steps.meta.outputs.labels }}
56+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-and-publish-database-mssql.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ env:
77
IMAGE_NAME: mssql
88
LABEL: 1.0.0
99

10+
permissions:
11+
contents: read
12+
packages: write
13+
1014
jobs:
1115
build_and_push:
1216
runs-on: ubuntu-latest
@@ -32,4 +36,4 @@ jobs:
3236
context: "{{defaultContext}}:dsagtt22/ordermicroservice/database-mssql"
3337
push: true
3438
tags: ${{ steps.meta.outputs.tags }}
35-
labels: ${{ steps.meta.outputs.labels }}
39+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-and-publish-frontend-ui5-mssql.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ env:
77
IMAGE_NAME: frontend-ui5-mssql
88
LABEL: 1.0.0
99

10+
permissions:
11+
contents: read
12+
packages: write
13+
1014
jobs:
1115
build_and_push:
1216
runs-on: ubuntu-latest
@@ -29,7 +33,7 @@ jobs:
2933
- name: Build and push Docker image
3034
uses: docker/build-push-action@v3.1.0
3135
with:
32-
context: "{{defaultContext}}:dsagtt22/ordermicroservice/frontend-ui5-mssql"
36+
context: "{{defaultContext}}:dsagtt22/ordermicroservice/frontend-ui5-mssql"
3337
push: true
3438
tags: ${{ steps.meta.outputs.tags }}
35-
labels: ${{ steps.meta.outputs.labels }}
39+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-and-publish-onprem-mock.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ env:
88
IMAGE_NAME: dsagtt22-onprem-mock
99
LABEL: 1.0.0
1010

11+
permissions:
12+
contents: read
13+
packages: write
14+
1115
jobs:
1216
build_and_push:
1317
runs-on: ubuntu-latest
@@ -21,13 +25,13 @@ jobs:
2125
uses: actions/setup-node@v3
2226
with:
2327
node-version: 16
24-
- name: 'Install dependencies and Build'
28+
- name: "Install dependencies and Build"
2529
shell: bash
2630
run: |
2731
pushd './dsagtt22/onprem-mock'
2832
npm ci
2933
npm run build
30-
popd
34+
popd
3135
- name: Log in to the Container registry (GH Packages)
3236
uses: docker/login-action@v2
3337
with:
@@ -47,4 +51,4 @@ jobs:
4751
context: ./${{ env.SUBDIRECTORY }}
4852
push: true
4953
tags: ${{ steps.meta.outputs.tags }}
50-
labels: ${{ steps.meta.outputs.labels }}
54+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-and-publish-sapcc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ env:
77
IMAGE_NAME: java11-sapcc
88
LABEL: 1.0.0
99

10+
permissions:
11+
contents: read
12+
packages: write
13+
1014
jobs:
1115
build_and_push:
1216
runs-on: ubuntu-latest
@@ -32,4 +36,4 @@ jobs:
3236
context: "{{defaultContext}}:dsagtt22/CloudConnector"
3337
push: true
3438
tags: ${{ steps.meta.outputs.tags }}
35-
labels: ${{ steps.meta.outputs.labels }}
39+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
name: Build docker for the Custom Component Sample
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
paths:
6-
- "custom-component-dapr/**"
6+
- "custom-component-dapr/**"
77
workflow_dispatch:
8-
schedule:
9-
- cron: '0 0 * * 0'
8+
9+
permissions:
10+
contents: read
11+
1012
jobs:
1113
build:
1214
runs-on: ubuntu-latest
1315
strategy:
14-
matrix:
15-
node-version: [14.x, 16.x]
16+
matrix:
17+
node-version: [14.x, 16.x]
1618
steps:
1719
- uses: actions/checkout@v3
1820
- name: Use Node.js ${{ matrix.node-version }}
1921
uses: actions/setup-node@v3
2022
with:
2123
node-version: ${{ matrix.node-version }}
22-
- name: 'Install dependencies and Build'
24+
- name: "Install dependencies and Build"
2325
shell: bash
2426
run: |
2527
pushd './custom-component-dapr'
2628
npm ci
2729
npm run build --if-present
2830
popd
29-
- name: 'Check for outdated dependencies'
31+
- name: "Check for outdated dependencies"
3032
shell: bash
3133
run: |
3234
pushd './custom-component-dapr'
3335
npm outdated --ignore-packages dapr-client@2.0.2
3436
popd
35-
- name: 'Build Docker Image'
37+
- name: "Build Docker Image"
3638
shell: bash
3739
run: |
3840
pushd './custom-component-dapr'
@@ -42,5 +44,5 @@ jobs:
4244
uses: rtCamp/action-slack-notify@v2.2.0
4345
if: ${{ failure() }}
4446
env:
45-
SLACK_MESSAGE: 'Build Failed for ${{ env.SAMPLE_NAME }}'
46-
SLACK_WEBHOOK: ${{ secrets.BUILD_FAIL_NOTIFY_SLACK_URL }}
47+
SLACK_MESSAGE: "Build Failed for ${{ env.SAMPLE_NAME }}"
48+
SLACK_WEBHOOK: ${{ secrets.BUILD_FAIL_NOTIFY_SLACK_URL }}
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
name: Build docker for the HANA Node.js Sample
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
paths:
6-
- "hana-nodejs/**"
6+
- "hana-nodejs/**"
77
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
812
jobs:
913
build:
1014
runs-on: ubuntu-latest
1115
strategy:
12-
matrix:
13-
node-version: [16.x, 18.x]
16+
matrix:
17+
node-version: [16.x, 18.x]
1418
steps:
1519
- uses: actions/checkout@v3
1620
- name: Use Node.js ${{ matrix.node-version }}
1721
uses: actions/setup-node@v3
1822
with:
1923
node-version: ${{ matrix.node-version }}
20-
- name: 'Install dependencies and Build'
24+
- name: "Install dependencies and Build"
2125
shell: bash
2226
run: |
2327
pushd './hana-nodejs/app'
2428
npm ci
2529
npm run build --if-present
2630
popd
27-
- name: 'Check for outdated dependencies'
31+
- name: "Check for outdated dependencies"
2832
shell: bash
2933
run: |
3034
pushd './hana-nodejs/app'
3135
npm outdated
3236
popd
33-
- name: 'Build Docker Image'
37+
- name: "Build Docker Image"
3438
shell: bash
3539
run: |
3640
pushd './hana-nodejs'
@@ -40,5 +44,5 @@ jobs:
4044
uses: rtCamp/action-slack-notify@v2.2.0
4145
if: ${{ failure() }}
4246
env:
43-
SLACK_MESSAGE: 'Build Failed for ${{ env.SAMPLE_NAME }}'
44-
SLACK_WEBHOOK: ${{ secrets.BUILD_FAIL_NOTIFY_SLACK_URL }}
47+
SLACK_MESSAGE: "Build Failed for ${{ env.SAMPLE_NAME }}"
48+
SLACK_WEBHOOK: ${{ secrets.BUILD_FAIL_NOTIFY_SLACK_URL }}

.github/workflows/build-docker-orders-service.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: Build docker for the Orders Service Sample
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
paths:
6-
- "orders-service/**"
6+
- "orders-service/**"
77
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
813
env:
914
REGISTRY: ghcr.io
1015
SUBDIRECTORY: orders-service

.github/workflows/build-docker-sample-extension-dotnet-minimalapi.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,37 @@ name: Build docker sample-extension-dotnet-minimalapi
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
paths:
7-
- "sample-extension-dotnet-minimalapi/**"
7+
- "sample-extension-dotnet-minimalapi/**"
88
workflow_dispatch:
9-
schedule:
10-
- cron: '0 0 * * 0'
9+
10+
permissions:
11+
contents: read
1112

1213
jobs:
1314
build:
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-dotnet@v2
18-
with:
19-
dotnet-version: '6.0.x'
20-
- name: 'Build .NET Project'
21-
shell: bash
22-
run: |
23-
pushd './sample-extension-dotnet-minimalapi/TodoApi'
24-
dotnet publish -c Release
25-
popd
26-
- name: Build the Docker image
27-
shell: bash
28-
run: |
29-
pushd './sample-extension-dotnet-minimalapi/'
30-
make build-image
31-
popd
32-
- name: Slack Notify
33-
uses: rtCamp/action-slack-notify@v2.2.0
34-
if: ${{ failure() }}
35-
env:
36-
SLACK_MESSAGE: 'Build Failed for ${{ env.SAMPLE_NAME }}'
37-
SLACK_WEBHOOK: ${{ secrets.BUILD_FAIL_NOTIFY_SLACK_URL }}
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-dotnet@v2
19+
with:
20+
dotnet-version: "6.0.x"
21+
- name: "Build .NET Project"
22+
shell: bash
23+
run: |
24+
pushd './sample-extension-dotnet-minimalapi/TodoApi'
25+
dotnet publish -c Release
26+
popd
27+
- name: Build the Docker image
28+
shell: bash
29+
run: |
30+
pushd './sample-extension-dotnet-minimalapi/'
31+
make build-image
32+
popd
33+
- name: Slack Notify
34+
uses: rtCamp/action-slack-notify@v2.2.0
35+
if: ${{ failure() }}
36+
env:
37+
SLACK_MESSAGE: "Build Failed for ${{ env.SAMPLE_NAME }}"
38+
SLACK_WEBHOOK: ${{ secrets.BUILD_FAIL_NOTIFY_SLACK_URL }}

0 commit comments

Comments
 (0)