Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this only be granted for actions/checkout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permissions are per job unfortunately, not per step. All jobs do checkout, so it makes sense to define it a global.


jobs:
test:
name: 'Tests on ${{matrix.platform}}'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ on:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: is this required if explicit permissions are specified for one of the jobs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is optional. I added it prevent the case when a new job is added and it inherits the default permissions, but as long as there is only one job it will use it's own permissions.

jobs:
release:
permissions:
contents: write # to create release
pull-requests: write # to create pull request
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you a Changeset user? did you have a chance to confirm that those are the only ones needed for this action?

Copy link
Contributor Author

@sashashura sashashura Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is optional. I added it prevent the case when a new job is added and it inherits the default permissions, but as long as there is only one job it will use it's own permissions. Wrong comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have a chance to try it. If it fails it can be expanded.


name: Release
runs-on: ubuntu-latest
steps:
Expand Down