-
-
Notifications
You must be signed in to change notification settings - Fork 122
Mention permissions configuration in the README.md #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,6 @@ jobs: | |
| # ... etc | ||
| ``` | ||
|
|
||
|
|
||
| ### Advanced: Canceling Other Workflows | ||
|
|
||
| In some cases, you may wish to avoid modifying all your workflows and instead create a new workflow that cancels your other workflows. This can be useful when you have a problem with workflows getting queued. | ||
|
|
@@ -121,6 +120,29 @@ jobs: | |
| access_token: ${{ github.token }} | ||
| ``` | ||
|
|
||
| ### Permissions control | ||
|
|
||
| No change to permissions is required by default. The instructions below or for improved control over of those permissions. | ||
adrienbernede marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| By default, Github creates the `GITHUB_TOKEN` for actions with some read/write permissions. It may be a good practice to switch to read-only permissions by default. Visit the [dedicated documentation page](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/disabling-or-limiting-github-actions-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository) for details. | ||
adrienbernede marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Permissions can be set in the workflow, globally or at job level, see the [reference manual page](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions). `cancel-workflow-action` only requires write access to the `actions` scope, so it is enough to have: | ||
styfle marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```yml | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: write | ||
| steps: | ||
| - name: Cancel Previous Runs | ||
| uses: styfle/[email protected] | ||
| with: | ||
| access_token: ${{ github.token }} | ||
| ``` | ||
|
|
||
| _Note_ : This is typical when global access is set to be restrictive. Only this job will elevate those permissions. | ||
|
|
||
| ## Contributing | ||
|
|
||
| - Clone this repo | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.