mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-09 16:18:34 +01:00
This workflow runs the PR and Push workflow files on a `pull_request` trigger. The intent is to test changes to the workflow files immediately. Previously, these were run directly from the respective workflow files. The new approach allows us to move the logic to run this only when workflow files changed from the pull_request trigger into a job. This has the advantage that older jobs are cleaned up, when the PR changes from a state of "workflow files changed" to "no workflow files changed". This can happen when changing a PR's base from staging to master, in which case changes from master would temporarily appear in the PR as changes. When these include changes to workflow files, this would trigger the PR workflow via `pull_request`. Once the base is changed, the PR is closed and re-opened, so CI runs again - but since it's on the same commit and the new run doesn't trigger `pull_request`, the results of the previous run are still kept and displayed. These results may include cancelled or failed jobs, which are impossible to recover from without another force-push. Checking this condition at run-time is only possible, because we move it into a separate workflow, turning the `pr.yml` workflow into a re-usable workflow. This will make sure to skip the whole workflow at once, when no change was detected, which will prevent the "no PR failures" job from appearing as skipped - which would imply "success" and make the PR mergeable immediately. Instead the "no PR failures" job is not shown at all for this trigger, which is generally what we want. Do the same for `push.yml` for consistency. |
||
|---|---|---|
| .. | ||
| .editorconfig | ||
| .gitignore | ||
| .npmrc | ||
| commits.js | ||
| labels.js | ||
| package-lock.json | ||
| package.json | ||
| prepare.js | ||
| README.md | ||
| run | ||
| shell.nix | ||
| withRateLimit.js | ||
GitHub specific CI scripts
This folder contains actions/github-script-based JavaScript code.
It provides a nix-shell environment to run and test these actions locally.
To run any of the scripts locally:
- Enter
nix-shellin./ci/github-script. - Ensure
ghis authenticated.
Check commits
Run ./run commits OWNER REPO PR, where OWNER is your username or "NixOS", REPO is the name of your fork or "nixpkgs" and PR is the number of the pull request to check.
Labeler
Run ./run labels OWNER REPO, where OWNER is your username or "NixOS" and REPO the name of your fork or "nixpkgs".