Skip to content

Commit

Permalink
[gh-1322] Potential permissions fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmind committed Jan 6, 2024
1 parent 26eab68 commit 557fe03
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/server-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
pull_request:
workflow_dispatch:

permissions:
id-token: write

jobs:
build-core:
name: 'Build (.NET 8)'
Expand Down Expand Up @@ -82,6 +85,8 @@ jobs:
environment: edge-server-x64
name: 'Deploy to Edge (${{ matrix.name }})'
runs-on: ubuntu-latest
permissions:
id-token: write
needs: build-core
if: github.ref == 'refs/heads/main'
environment: ${{ matrix.environment }}
Expand Down Expand Up @@ -142,6 +147,8 @@ jobs:
environment: edge-server-netfx-x64
name: 'Deploy to Edge (${{ matrix.name }})'
runs-on: ubuntu-latest
permissions:
id-token: write
needs: build-netfx
if: github.ref == 'refs/heads/main'
environment: ${{ matrix.environment }}
Expand All @@ -167,6 +174,8 @@ jobs:
create-release:
name: 'Create Release'
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- deploy-core
- deploy-netfx
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/server-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:

name: 'Deploy to Main (${{ matrix.name }})'
runs-on: ubuntu-latest
permissions:
id-token: write
environment: ${{ matrix.environment }}
steps:
- uses: actions/github-script@v6
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/webapp-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ on:
pull_request:
workflow_dispatch:

permissions:
id-token: write

jobs:
build:
name: Build
# https://github.uint.cloudmunity/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012/5
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: source/WebApp
Expand Down Expand Up @@ -110,6 +109,8 @@ jobs:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/feature/execution-flow-output-squashed'
environment: edge-webapp
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/webapp-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ name: WebApp (JS) - Main

on: workflow_dispatch

permissions:
id-token: write

jobs:
deploy-to-main:
name: Deploy (Main)
environment: main-webapp
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: azure/login@v1
with:
Expand Down

0 comments on commit 557fe03

Please sign in to comment.