Skip to content

Change permissions from read to write for contents#264

Merged
pierotofy merged 1 commit intoOpenDroneMap:masterfrom
sylveon:patch-1
Mar 17, 2026
Merged

Change permissions from read to write for contents#264
pierotofy merged 1 commit intoOpenDroneMap:masterfrom
sylveon:patch-1

Conversation

@sylveon
Copy link
Contributor

@sylveon sylveon commented Mar 17, 2026

#263 added granular permissions to grant id-token: write (which isn't granted by default). When doing this, I also added contents: read because granular permissions overwrite repo-level permissions, and not having it prevented the workflow from cloning its own repo.

However, the svenstaro/upload-release-action action requires contents: write, which the pipeline no longer had. Change contents to write (which implies read) to fix that.

OpenDroneMap#263 added granular permissions to grant `id-token: write` (which isn't granted by default). When doing this, I also added `contents: read` because granular permissions overwrite repo-level permissions, and not having it prevented the workflow from cloning its own repo.

However, the `svenstaro/upload-release-action` action requires `contents: write`, which the pipeline no longer had. Change `contents` to `write` (which implies `read`) to fix that.
@pierotofy
Copy link
Member

pierotofy commented Mar 17, 2026

Mm.

By default, these permissions are granted on push but not on pr - and you should be wary of adding them to workflows that run on pr, as they allow wide access to changing the entire repo's contents

https://github.com/svenstaro/upload-release-action?tab=readme-ov-file#permissions

@sylveon
Copy link
Contributor Author

sylveon commented Mar 17, 2026

Previously, the write permission was implied this repository setting, but it didn't grant id-token: write (which is required for Azure Login):
image

However, now that we're using granular permission to grant id-token: write, it overrides this repo setting, so the permission was no longer implied and contents: read means the GITHUB_TOKEN no longer had write permission.

@pierotofy
Copy link
Member

Maybe contents: read needs to be removed?

@sylveon
Copy link
Contributor Author

sylveon commented Mar 17, 2026

Without contents: read, the GITHUB_TOKEN has no permission at all for contents - it can't clone the repo or upload release artifacts.

@pierotofy
Copy link
Member

That makes sense. Thanks for the clarification. 🙏

@pierotofy pierotofy merged commit d53feb5 into OpenDroneMap:master Mar 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants