Skip to content

Commit 58319fc

Browse files
authored
docs: add github permissions section to semantic pull request workflow (#138)
* docs: add github permissions section to semantic pull request workflow * fix: format * chore: upgrade pana version to fix compatibility with latest flutter version ---------
1 parent 6981cc0 commit 58319fc

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
verify-pana-dart:
2626
uses: ./.github/workflows/pana.yml
2727
with:
28-
pana_version: 0.21.32
28+
pana_version: 0.21.36
2929
min_score: 95
3030
working_directory: examples/dart_package
3131

3232
verify-pana-flutter:
3333
uses: ./.github/workflows/pana.yml
3434
with:
35-
pana_version: 0.21.32
35+
pana_version: 0.21.36
3636
min_score: 95
3737
working_directory: examples/flutter_package
3838

site/docs/workflows/semantic_pull_request.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ The semantic pull request package workflow consists of the following step:
2424

2525
**Optional** Configure which scopes are allowed (e.g. `"dart_package, flutter_package"`).
2626

27+
## GitHub Permissions
28+
29+
When running this workflow, the `GITHUB_TOKEN` has to have the correct permissions to run successfully. On public repositories, the default settings grant the token enough permissions to run correctly. However, on private repositories, settings have to be updated. There are two ways of doing so:
30+
31+
- **Repository wide update.** Inside your repository, go to _Settings > Actions > General_, scroll down to the _Workflow permissions_ section and update it to allow _Read and write permissions_. Don't forget to save the changes.
32+
- **Workflow specific update.** In your workflow `yaml` file, you can modify the permissions for the `GITHUB_TOKEN`. For this workflow to work you have to enable write permissions for pull requests in your job as follows.
33+
34+
```yaml
35+
jobs:
36+
build:
37+
permissions:
38+
pull-requests: write
39+
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1
40+
```
41+
42+
You can read more about this in the [github documentation](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token).
43+
2744
## Example Usage
2845
2946
```yaml

0 commit comments

Comments
 (0)