Skip to content

Maintenance: docs should not be published at each commit in a PR but only when merged #1053

Closed
@dreamorosi

Description

@dreamorosi

Bug description

With the introduction of a new workflow architecture/design in #1023 the workflow that is supposed to be run on merge is now ran as a result of the successful execution of another workflow that runs every time a PR is updated. This is in the name of security and to avoid running privileged workflows directly on a code change that could come from a fork.

The changes introduced a faulty behaviour that causes the docs to be published every time any PR is updated, which should not be the case.

Expected Behavior

Docs to be published only when the PR is actually merged.

Current Behavior

Publish step runs all the time

image

Possible Solution

Add a guard in the publish job like this:

if: needs.get_pr_details.outputs.prIsMerged == 'true'

so that the job is run only when the PR is merged

Steps to Reproduce

Open a PR / update it / update it / ..

Environment

  • Powertools version used: main
  • Packaging format (Layers, npm): N/A
  • AWS Lambda function runtime: N/A
  • Debugging logs: N/A

Related issues, RFCs

#1023

Metadata

Metadata

Assignees

Labels

automationThis item relates to automationcompletedThis item is complete and has been merged/shipped

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions