Skip to content

Commit

Permalink
Add sample of permissions/Fix permissions of existing jobs (#162)
Browse files Browse the repository at this point in the history
* Add sample of permissions

* fix permissions on Actions

* add checks
  • Loading branch information
m-tmatma authored Apr 14, 2024
1 parent a1fe18e commit 0f5f92e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
pull_request:

permissions:
contents: read
contents: write
checks: write
pull-requests: write

jobs:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/multiple-files.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Test Multipli File
on:
pull_request:

permissions:
contents: write
checks: write
pull-requests: write

jobs:
test-multiple-files:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
pull_request:
push:

permissions:
contents: write
checks: write
pull-requests: write

jobs:
test-branch:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/update-coverage-on-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
push:
branches:
- test-branch

permissions:
contents: write
checks: write
pull-requests: write

jobs:
update-coverage-on-readme:
runs-on: ubuntu-latest
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ on:
pull_request:
branches:
- '*'
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# `contents` is for permission to the contents of the repository.
# `pull-requests` is for permission to pull request
permissions:
contents: write
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -226,6 +235,15 @@ If your coverage html report will not change, it wouldn't push any changes to re
name: Update Coverage on Readme
on:
push:
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# `contents` is for permission to the contents of the repository.
# `pull-requests` is for permission to pull request
permissions:
contents: write
checks: write
pull-requests: write

jobs:
update-coverage-on-readme:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 0f5f92e

Please sign in to comment.