Skip to content

Commit c25d664

Browse files
committed
Add GitHub Actions Permissions
1 parent 1218409 commit c25d664

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
environment:
6161
name: 'GitHub Packages'
6262
url: https://github.com/RehanSaeed/Schema.NET/packages
63+
permissions:
64+
packages: write
6365
runs-on: windows-latest
6466
steps:
6567
- name: 'Download Artefact'

.github/workflows/codeql-analysis.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,34 @@ name: "CodeQL"
77

88
on:
99
push:
10-
branches: [master]
10+
branches: [ main ]
1111
pull_request:
1212
# The branches below must be a subset of the branches above
13-
branches: [master]
13+
branches: [ main ]
1414
schedule:
1515
- cron: '0 7 * * 4'
1616
workflow_dispatch:
1717

1818
jobs:
1919
analyze:
2020
name: Analyze
21+
permissions:
22+
actions: read
23+
contents: read
24+
security-events: write
2125
runs-on: ubuntu-latest
2226

2327
strategy:
2428
fail-fast: false
2529
matrix:
26-
# Override automatic language detection by changing the below list
27-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
28-
language: ['csharp']
29-
# Learn more...
30-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
30+
language: [ 'csharp' ]
31+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
32+
# Learn more:
33+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3134

3235
steps:
3336
- name: Checkout repository
3437
uses: actions/[email protected]
35-
with:
36-
# We must fetch at least the immediate parents so that if this is
37-
# a pull request then we can checkout the head.
38-
fetch-depth: 2
39-
40-
# If this run was triggered by a pull request event, then checkout
41-
# the head of the pull request instead of the merge commit.
42-
- run: git checkout HEAD^2
43-
if: ${{ github.event_name == 'pull_request' }}
4438

4539
# Initializes the CodeQL tools for scanning.
4640
- name: Initialize CodeQL

.github/workflows/release-drafter.yml

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

99
jobs:
1010
update_release_draft:
11+
permissions:
12+
contents: write
13+
pull-requests: read
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: release-drafter/release-drafter@v5

0 commit comments

Comments
 (0)