Skip to content

CI: Protect manual package publishing workflows - #34733

Merged
r-farkhutdinov merged 5 commits into
mainfrom
protect-workflows
Aug 12, 2026
Merged

CI: Protect manual package publishing workflows#34733
r-farkhutdinov merged 5 commits into
mainfrom
protect-workflows

Conversation

@r-farkhutdinov

Copy link
Copy Markdown
Contributor

No description provided.

@r-farkhutdinov r-farkhutdinov self-assigned this Aug 11, 2026
@r-farkhutdinov
r-farkhutdinov requested a review from a team as a code owner August 11, 2026 12:23
Copilot AI lite review requested due to automatic review settings August 11, 2026 12:23
@r-farkhutdinov r-farkhutdinov changed the title CI: Protect manual package publishing workflows- #34694 CI: Protect manual package publishing workflows Aug 11, 2026
@alexslavr
alexslavr deployed to packages-publishing August 11, 2026 12:24 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens protections around manual publishing/deployment workflows by introducing explicit GitHub Actions permissions and adding environment-gated approval steps for sensitive operations (package publishing, storybook cleanup, demos deployment).

Changes:

  • Added explicit permissions blocks to reduce default token scope and introduced environment protections for deploy/publish jobs.
  • Added manual-approval “gate” jobs (via protected environments) for storybook cleanup and package publishing/scheduler manual runs.
  • Refactored the packages publishing scheduler to call the publishing workflow via workflow_call and added a branch input to publish from specific branches.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/publish-demos.yml Restricts default token permissions; adds environment + job-level permissions for gh-pages deployment.
.github/workflows/pr-storybook-deploy.yml Associates cleanup/removal job with the Storybook environment + deployment URL.
.github/workflows/pr-storybook-cleanup.yml Adds an environment-gated approval job for manual cleanup runs and wires it into the cleanup job.
.github/workflows/packages_publishing.yml Adds workflow_call support + branch selection and introduces an environment-gated approval job before publishing.
.github/workflows/packages_publishing_scheduler.yml Adds an environment-gated approval job for manual dispatch and switches to calling the reusable publishing workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/publish-demos.yml
Comment thread .github/workflows/packages_publishing.yml
Comment thread .github/workflows/packages_publishing_scheduler.yml
Copilot AI review requested due to automatic review settings August 11, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.github/workflows/packages_publishing.yml:179

  • If workflow-level permissions are reduced (recommended), the publish job should explicitly request packages: write (and keep contents: read for checkout) since it performs pnpm publish to GitHub Packages.
  publish:
    name: Publish package
    runs-on: ubuntu-slim
    needs: [build, approve-package-publishing]
    if: ${{ always() && !cancelled() && needs.build.result == 'success' && (needs.approve-package-publishing.result == 'success' || needs.approve-package-publishing.result == 'skipped') }}

.github/workflows/packages_publishing.yml:35

  • Workflow-level packages: write grants write access to GitHub Packages for all jobs (including build/notify), which increases blast radius if any step or action is compromised. Consider defaulting to packages: read and granting packages: write only on the publish job that actually pushes packages.

This issue also appears on line 175 of the same file.

permissions:
  contents: read
  packages: write

@alexslavr
alexslavr had a problem deploying to packages-publishing August 12, 2026 09:05 — with GitHub Actions Failure
Copilot AI review requested due to automatic review settings August 12, 2026 09:16
@alexslavr alexslavr added the 26_2 label Aug 12, 2026
alexslavr
alexslavr previously approved these changes Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/workflows/packages_publishing.yml:47

  • The approval gate condition uses contains(github.workflow_ref, '/.github/workflows/packages_publishing_scheduler.yml@'), but github.workflow_ref points to the workflow being executed (this file), not the caller workflow. That substring will never match, so the extra clause is ineffective and makes the protection logic harder to reason about.

Consider basing the condition purely on how the workflow was invoked (dispatch vs reusable call) and the requested tag.

  approve-package-publishing:
    name: Approve package publishing
    if: ${{ inputs.tag == 'stable' || (github.event_name == 'workflow_dispatch' && !contains(github.workflow_ref, '/.github/workflows/packages_publishing_scheduler.yml@')) }}
    runs-on: ubuntu-latest

mpreyskurantov
mpreyskurantov previously approved these changes Aug 12, 2026
Copilot AI review requested due to automatic review settings August 12, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment on lines 184 to +188
steps:
- name: Get sources
uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.ref }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested manually: skipped job will not re-run.

@r-farkhutdinov
r-farkhutdinov added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 31d6aac Aug 12, 2026
102 checks passed
@r-farkhutdinov
r-farkhutdinov deleted the protect-workflows branch August 12, 2026 11:27
r-farkhutdinov added a commit to r-farkhutdinov/DevExtreme that referenced this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants