powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

Bug (build): docs should not be published at each commit in a PR but only when merged

Open dreamorosi opened this issue 3 years ago • 0 comments

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

dreamorosi avatar Aug 11 '22 14:08 dreamorosi