Skip to content

Commit 568722a

Browse files
authored
chore(workflows): Add permissions for contents and pull-requests (#439)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> This pull request includes updates to several GitHub Actions workflows to add permissions for reading contents and writing pull requests. Additionally, there is a minor change to the `lint-pr.yml` workflow file to standardize the quotation marks used in the `name` field. Workflow permissions updates: * [`.github/workflows/ci.yml`](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR15-R17): Added permissions for reading contents and writing pull requests to the `build` job. * [`.github/workflows/code-coverage.yml`](diffhunk://#diff-49708f979e226a1e7bd7a68d71b2e91aae8114dd3e9254d9830cd3b4d62d4303R15-R17): Added permissions for reading contents and writing pull requests to the `build-test-report` job. * [`.github/workflows/dco-merge-group.yml`](diffhunk://#diff-cbf8f01aa06b4aa3d0729c5bce44e4f919c801b55f19a781b15f62aa10e68e90R10-R12): Added permissions for reading contents and writing pull requests to the `DCO` job. * [`.github/workflows/dotnet-format.yml`](diffhunk://#diff-ca8c2611c79b991c0fbe04fec3c97c14dc83419f5efb1e8a7a96dd51e7df3e2aR12-R14): Added permissions for reading contents and writing pull requests to the `check-format` job. * [`.github/workflows/e2e.yml`](diffhunk://#diff-3e103440521ada06efd263ae09b259e5507e4b8f7408308dc227621ad9efa31eR16-R18): Added permissions for reading contents and writing pull requests to the `e2e-tests` job. * [`.github/workflows/lint-pr.yml`](diffhunk://#diff-70c3a017bfdb629fd50281fe5f7ad22e29c0ddac36e7065e9dc6d4f0924104f4R14-R16): Added permissions for reading contents and writing pull requests to the `main` job. Standardization: * [`.github/workflows/lint-pr.yml`](diffhunk://#diff-70c3a017bfdb629fd50281fe5f7ad22e29c0ddac36e7065e9dc6d4f0924104f4L1-R1): Changed single quotes to double quotes in the `name` field. Signed-off-by: André Silva <[email protected]>
1 parent 73207d0 commit 568722a

File tree

6 files changed

+19
-1
lines changed

6 files changed

+19
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212

1313
jobs:
1414
build:
15+
permissions:
16+
contents: read
17+
pull-requests: write
1518
strategy:
1619
matrix:
1720
os: [ubuntu-latest, windows-latest]

.github/workflows/code-coverage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212

1313
jobs:
1414
build-test-report:
15+
permissions:
16+
contents: read
17+
pull-requests: write
1518
strategy:
1619
matrix:
1720
os: [ubuntu-latest, windows-latest]

.github/workflows/dco-merge-group.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
jobs:
88
DCO:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
1013
if: ${{ github.actor != 'renovate[bot]' }}
1114
steps:
1215
- run: echo "dummy DCO workflow (it won't run any check actually) to trigger by merge_group in order to enable merge queue"

.github/workflows/dotnet-format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
check-format:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pull-requests: write
1215

1316
steps:
1417
- name: Check out code

.github/workflows/e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
jobs:
1414
e2e-tests:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
pull-requests: write
1619
steps:
1720
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1821
with:

.github/workflows/lint-pr.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Lint PR'
1+
name: "Lint PR"
22

33
on:
44
pull_request_target:
@@ -11,6 +11,9 @@ jobs:
1111
main:
1212
name: Validate PR title
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: write
1417
steps:
1518
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
1619
env:

0 commit comments

Comments
 (0)