workflows: Fix pkgs/by-name checks not running for non-committers#254371
workflows: Fix pkgs/by-name checks not running for non-committers#254371
Conversation
|
It's likely that it isn't related to nixpkgs/.github/workflows/editorconfig.yml Lines 5 to 7 in 78058d8 Checkout would need to be updated as well. nixpkgs/.github/workflows/editorconfig.yml Lines 27 to 30 in 78058d8 |
|
@zowoq can you make the appropriate change? |
|
This should be all that is needed but would still need to verify that it works, it might make other assumptions about the env it runs in that could be different for pull_request_target. diff --git a/.github/workflows/check-by-name.yml b/.github/workflows/check-by-name.yml
index 9622634fcffd..07e881b1f05d 100644
--- a/.github/workflows/check-by-name.yml
+++ b/.github/workflows/check-by-name.yml
@@ -4,7 +4,10 @@ name: Check pkgs/by-name
# The pre-built tool is fetched from a channel,
# making it work predictable on all PRs
-on: pull_request
+
+on:
+ # avoids approving first time contributors
+ pull_request_target
# The tool doesn't need any permissions, it only outputs success or not based on the checkout
permissions: {}
@@ -16,6 +19,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
+ with:
+ # pull_request_target checks out the base branch by default
+ ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: cachix/install-nix-action@v22
- name: Determining channel to use for dependencies
run: |
|
927e264 to
6b8e029
Compare
|
Thanks for the report/fix! I'm going to test this in a nixpkgs fork when I get the chance |
Co-Authored-By: zowoq <[email protected]>
6b8e029 to
437d00d
Compare
|
I just tried this out and can confirm that it works. I took the liberty to push the fix to this branch directly. |
|
Merged to avoid amassing more workflows that need to be approved. I now also went through all the ones that were waiting for approval and approved them. So this should be fully addressed now. |
Description of changes
While reviewing #254368 I noticed I had to approve the workflow.
Copied the
permissionsdefinition from another workflow.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)