Skip to content

cicd: close upon merge for forks has no secret access #1611

@scottschreckengaust

Description

@scottschreckengaust

Describe the bug

When a pr is closed from a fork, it does not have access to the github action secrets. So the github command line fails.

Expected Behavior

When a PR closes the github cli can run:

  env:
    GH_TOKEN: ***

Current Behavior

When a PR closes the secrets is unavailable:

gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable. Example:
  env:
    GH_TOKEN: ${{ github.token }}
Error: Process completed with exit code 4.

Reproduction Steps

Run a pr from a branch and merge (it closes and runs the github cli command successfully)

Possible Solution

Change the trigger from pull_request to pull_request_target (need to consider the risks)

Additional Information/Context

No response

OS

N/A

Server

other

Server Version

N/A

Region experiencing the issue

N/A

Other information

No response

Service quota

  • I have reviewed the service quotas for this construct

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions