Commit d15beb2
fix: increase token scope to create PRs or sent events in other repositories (#1834)
After the release action creates a release successfully, it sends an
event to trigger this
[workflow](https://github.com/open-component-model/ocm/blob/44e518eb1228ef2eddaac0bf71cb25941701636b/.github/workflows/publish-to-other-than-github.yaml),
so the release is propagated through other repositories (website, brew)
and package registries (chocolatey, ...).
For the release `0.36.0` the workflow
[failed](https://github.com/open-component-model/ocm/actions/runs/22340840543)
for the ocm-website and homebrew-tab with an error such as
```log
Error: Error creating blob for file 'Formula/ocm@0.36.0.rb': Resource not accessible by integration - https://docs.github.com/rest/git/blobs#create-a-blob
```
The `Resource not accessible by integration` indicates a
permission-scope issue.
A week before the workflow was run, the generation of GitHub-Tokens was
[changed](001ac9f):
```diff
- uses: tibdex/github-app-token@3beb63f # v2.1.0
+ uses: actions/create-github-app-token@29824e6 # v2
```
However, the `create-github-app-token` action does only grant
permissions for the current repository. Accordingly, any event (website)
or creation of PR (brew) will fail as these are other repositories. To
resolve this, we need to set `owner: ${{ github.repository_owner }}` to
create a token [for all repositories in the current owner's
installation](https://github.com/actions/create-github-app-token?tab=readme-ov-file#create-a-token-for-all-repositories-in-the-current-owners-installation)
(see related
[discussion](https://github.com/orgs/community/discussions/69154#discussioncomment-7191057)).
---------
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Co-authored-by: Gerald Morrison <67469729+morri-son@users.noreply.github.com>1 parent 7c0adfc commit d15beb2
File tree
2 files changed
+3
-0
lines changed- .github/workflows
2 files changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
0 commit comments