Skip to content
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

github: fix workflow permissions error #58

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

Gandem
Copy link
Member

@Gandem Gandem commented Sep 5, 2024

currently, the publish job, although not used at all by the release workflow, is imported as part of the build.yaml import (for the side effect of importing lint, tests and build jobs).

however, this is causing an issue since we switched the default permissions to contents/packages read instead of write. as the publish job requires the write permission, however, build.yaml is imported with the standard permissions, causing the following error:

The workflow is not valid. .github/workflows/release.yml (Line: 9, Col: 3): Error calling workflow 'DataDog/otel-profiling-agent/.github/workflows/build.yml@5d1ecca'. The nested job 'publish' is requesting 'contents: write, packages: write', but is only allowed 'contents: read, packages: read'.

To fix this, we create a new workflow, pre-release, that contains the publish job, this way common build, lint, tests jobs can be imported by both release and pre-release without causing any issue

https://datadoghq.atlassian.net/browse/PROF-10450

currently, the publish job, although not used at all by the release
workflow, is imported as part of the build.yaml import (for the
side effect of importing lint, tests and build jobs).

however, this is causing an issue since we switched the default
permissions to contents/packages read instead of write. as the
publish job requires the write permission, however, build.yaml
is imported with the standard permissions, causing the following
error:

The workflow is not valid. .github/workflows/release.yml (Line: 9, Col: 3): Error calling workflow 'DataDog/otel-profiling-agent/.github/workflows/build.yml@5d1ecca'. The nested job 'publish' is requesting 'contents: write, packages: write', but is only allowed 'contents: read, packages: read'.

To fix this, we create a new workflow, pre-release, that contains
the publish job, this way common build, lint, tests jobs can be
imported by both release and pre-release without causing any issue
@Gandem Gandem requested a review from a team as a code owner September 5, 2024 13:08
@Gandem Gandem merged commit 3c6fb18 into main Sep 5, 2024
15 checks passed
@Gandem Gandem deleted the nayef/fix-perm-issue branch September 5, 2024 13:17
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