Skip to content

Commit d7e2087

Browse files
committed
ci: fix spelling action failure (#922)
There is [code in spelling check](https://github.com/check-spelling/check-spelling/blob/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/unknown-words.sh#L182) which probes branch renaming to make sure that pipeline is set up according to the [guide](https://docs.check-spelling.dev/Feature:-Restricted-Permissions). It doesn't specify request body and looks for a specific message in the response assuming that token check happens before body validation. Seems like GitHub change behavior and body schema is validated before permissions, so such request fails with a different error now: ``` curl -s -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $GITHUB_TOKEN" \ "https://api.github.com/repos/a2aproject/a2a-python/branches/1.0-dev/rename" { "message": "Invalid request.\n\nFor 'links/0/schema', nil is not an object.", "documentation_url": "https://docs.github.com/rest/branches/branches#rename-a-branch", "status": "422" } ``` Providing body gives a proper error: ```json { "message": "Resource not accessible by personal access token", "documentation_url": "https://docs.github.com/rest/branches/branches#rename-a-branch", "status": "403" } ``` Trying to update the workflow according to the sample https://raw.githubusercontent.com/check-spelling/spell-check-this/main/.github/workflows/spelling.yml.
1 parent 5d49f4a commit d7e2087

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/spelling.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: Check Spelling
33
on:
4-
pull_request:
5-
branches: ['**']
4+
pull_request_target:
5+
branches: ["**"]
66
types: [opened, reopened, synchronize]
77
issue_comment:
88
types: [created]
@@ -11,6 +11,7 @@ jobs:
1111
name: Check Spelling
1212
permissions:
1313
contents: read
14+
pull-requests: read
1415
actions: read
1516
security-events: write
1617
outputs:
@@ -74,6 +75,6 @@ jobs:
7475
cspell:sql/src/tsql.txt
7576
cspell:terraform/dict/terraform.txt
7677
cspell:typescript/dict/typescript.txt
77-
check_extra_dictionaries: ''
78+
check_extra_dictionaries: ""
7879
only_check_changed_files: true
79-
longest_word: '10'
80+
longest_word: "10"

0 commit comments

Comments
 (0)