Closed pgwillia closed 3 years ago
Starting March 1st, 2021 workflow runs that are triggered by Dependabot from
push
,pull_request
,pull_request_review
, orpull_request_review_comment
events will be treated as if they were opened from a repository fork. This means they will receive a read-onlyGITHUB_TOKEN
and will not have access to any secrets available in the repository. This will cause any workflows that attempt to write to the repository to fail.This change will affect all repositories, both public and private, regardless of how they are configured, and is being made to prevent potentially compromised dependencies from capturing secrets referenced in your workflows.
If your workflow needs to have a write token or access to secrets, you can use the
pull_request_target
event; however, please read Keeping your GitHub Actions and workflows secure: Preventing pwn requests to better understand the risks.
This is a correct behavior, not an issue. In the Checks of a PR, it will list all the jobs from the workflows run on the push event and the pull_request event based on the latest commit in the HEAD branch (source branch of the PR). Currently, we have no methods to only list the the jobs run on the pull_request event.
Because you configure your “Node CI” workflow runs on both push and pull_request , when you push commit the workflow will be triggered, and when the PR is Open , this workflow also will be triggered by the pull_request. So on the checks list of your PR, it will list two similar checks triggered by different events ( push and pull_request ).
When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.
Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.
With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository. The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information, see "Authenticating with the GITHUB_TOKEN."
Note: Workflows triggered by Dependabot pull requests are treated as though they are from a forked repository, and are also subject to these restrictions.
Some things we could try to workaround this bug
GITHUB_TOKEN
instead of DANGER_GITHUB_API_TOKEN
https://github.com/ualbertalib/jupiter/blob/3e2d4ae5cd3bc3b1f227b843a725dc1b34d5f10a/.github/workflows/push.yml#L37-L40 This is also mentioned in the danger docs.on: pull_request
redundant to on: push
? If so then remove pull_request
from the configuration.
https://github.com/ualbertalib/jupiter/blob/3e2d4ae5cd3bc3b1f227b843a725dc1b34d5f10a/.github/workflows/push.yml#L2pull_requests
into its own workflow
Describe the bug A missing token [
DANGER_GITHUB_API_TOKEN
] for Danger will cause our CI to fail. This is especially strange because it doesn't happen for every developer PR but does for all Dependabot PRs.To Reproduce Steps to reproduce the behavior:
A workaround for this is to Re-run jobs. It will often be fine after the re-run.
Expected behavior CI is continuous, error and intervention free.
Screenshots
https://github.com/ualbertalib/jupiter/blob/3e2d4ae5cd3bc3b1f227b843a725dc1b34d5f10a/.github/workflows/push.yml#L37-L40