Commit Graph

37 Commits

Author SHA1 Message Date
Wolfgang Walther
bfe12571b4 workflows: checkout nixpkgs in get-merge-commit action
This makes checking out the nixpkgs repo even more consistent and almost
forces us to use the trusted/untrusted path pattern.

(cherry picked from commit 0e1c284b13)
2025-05-25 15:10:33 +00:00
Wolfgang Walther
a55f7ddced workflows: checkout nixpkgs into trusted/untrusted directories
By consistently checking out nixpkgs into the same location in every
workflow, it's easier to reason about the different workflows at once.
We also use crystal-clear names to make clear, which checkouts are
considered trusted, because they only contain target-branch-code and
which checkouts are untrusted, because they contain code from the head
branch. By naming the checkout directories trusted/untrusted, it's
obvious at the call-site.

One example of where we likely did the wrong thing is the nixpkgs-vet
workflow: Fetching the toolVersion from the untrusted checkout opens the
door for an injection into the download URL, thus code could be
downloaded from anywhere. This is not a problem, because this workflow
does not run with elevated privileges, but it's a scary oversight
nonetheless.

(cherry picked from commit 6720d25429)
2025-05-25 15:10:33 +00:00
Wolfgang Walther
55651d1260 workflows/{codeowners,eval}: move env before run
`env` blocks are a bit like `let` blocks in Nix. They define a few
things, which are then used in the `run` block. The workflows are
considerably easier to read, if those definitions come first, making it
crystal clear where they belong and requiring less visual jumping.

(cherry picked from commit 82396d1f48)
2025-05-24 10:46:34 +00:00
Wolfgang Walther
e2a2997127 workflows/get-merge-commit: move to composite action
We don't need a separate workflow anymore, because we don't need to skip
dependent jobs on failures anymore. The biggest failure mode was
"conflict" previously, but we resolved that on the last commit. The
remaining failure modes are so rare, that it's OK to just fail the jobs
in this case instead of marking them as "skipped". Especially, because
the resolve-merge-commit job would have previously failed anyway.

By moving this to an action we avoid running separate jobs each time we
need the merge commit. This also makes the check list in PRs much
cleaner.

(cherry picked from commit e48d9d6174)
2025-05-24 10:25:43 +00:00
Wolfgang Walther
042d2e6417 workflows: avoid running jobs when editing title etc.
We intend to use the edited event to react to base branch changes - but
before this change, we also ran those jobs on simple edits like title or
description.

While this works for some of the quicker jobs, it will not be
sustainable for all evaluation-related jobs. But evaluation needs to be
re-triggered on a base branch change as well, thus this change.

(cherry picked from commit 9b01e09a35)
2025-05-22 19:14:03 +00:00
Wolfgang Walther
65315e5400 workflows: self-test on change
All workflows where it's remotely useful now trigger on a pull_request
event when the workflow file itself is changed. This gives us basic
sanity testing of changes to workflow files itself and reduces the need
for manual tests in forks.
2025-05-14 08:18:38 +02:00
Wolfgang Walther
d3e4865b10 workflows: use ARM runners
ARM runners are supposed to be more energy efficient than x86. Also,
from limited testing, they appear to be faster for the eval jobs as
well. Average run time for the "Outpaths (x86_64-linux)" job was 4m 27s,
so far. In the first run, this job came in at 3m 9s. This effect did not
show for other jobs, yet.

The following two exceptions are made right now:
- nixpkgs-lib-tests currently fails on the ARM runner building Nix 2.3
- nixpkgs-vet is currently pinned to a x86_64-linux only binary release
2025-05-11 12:11:10 +02:00
Philip Taron
e7072d135f build(deps): bump cachix/install-nix-action from 31.2.0 to 31.3.0 (#404347) 2025-05-06 10:54:26 -07:00
dependabot[bot]
f068c68b2e build(deps): bump cachix/install-nix-action from 31.2.0 to 31.3.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.2.0 to 31.3.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](754537aaed...5261181216)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 11:37:17 +00:00
dependabot[bot]
77ea92cfca build(deps): bump actions/create-github-app-token from 2.0.2 to 2.0.6
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.0.2 to 2.0.6.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](3ff1caaa28...df432ceedc)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 2.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 11:36:15 +00:00
Wolfgang Walther
624010d02b build(deps): bump cachix/install-nix-action from 31.1.0 to 31.2.0 (#400521) 2025-05-02 18:11:38 +00:00
dependabot[bot]
1de4a06154 build(deps): bump cachix/install-nix-action from 31.1.0 to 31.2.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.1.0 to 31.2.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](d1ca217b38...754537aaed)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-21 12:30:12 +00:00
Wolfgang Walther
40528439f3 workflows: make requested permissions explicit for create-github-app-token
Resolves #396875
2025-04-12 19:10:26 +02:00
dependabot[bot]
4e21d3ba46 build(deps): bump actions/create-github-app-token from 1.11.7 to 2.0.2
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.7 to 2.0.2.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](af35edadc0...3ff1caaa28)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 11:47:12 +00:00
dependabot[bot]
0e553a831e build(deps): bump cachix/install-nix-action from {30,31} to 31.1.0 (#394893) 2025-04-01 19:43:48 +00:00
dependabot[bot]
56de6fd33d build(deps): bump actions/create-github-app-token from 1.11.6 to 1.11.7
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.6 to 1.11.7.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](21cfef2b49...af35edadc0)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 12:16:28 +00:00
Wolfgang Walther
3fa48f3377 Reapply "build(deps): bump cachix/install-nix-action from 30 to 31"
This reverts commit 281875261d.
2025-03-19 20:38:45 +01:00
Philip Taron
4181800d30 Revert "build(deps): bump cachix/install-nix-action from 30 to 31" (#390695) 2025-03-17 08:09:59 -07:00
Wolfgang Walther
5a9d36cf6b build(deps): bump cachix/cachix-action from 15 to 16 (#390646) 2025-03-17 15:06:32 +00:00
Philip Taron
281875261d Revert "build(deps): bump cachix/install-nix-action from 30 to 31" 2025-03-17 08:05:43 -07:00
dependabot[bot]
8cad67f2a3 build(deps): bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](08dcb3a5e6...02a151ada4)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 11:39:46 +00:00
dependabot[bot]
2f2a95ddcc build(deps): bump cachix/cachix-action from 15 to 16
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 15 to 16.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](ad2ddac53f...0fc020193b)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 11:37:30 +00:00
dependabot[bot]
94816e8c96 build(deps): bump actions/create-github-app-token from 1.11.5 to 1.11.6
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.5 to 1.11.6.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](0d564482f0...21cfef2b49)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 11:17:16 +00:00
dependabot[bot]
f66585fd39 build(deps): bump actions/create-github-app-token from 1.11.3 to 1.11.5
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.3 to 1.11.5.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](67e27a7eb7...0d564482f0)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 11:47:47 +00:00
dependabot[bot]
95e123c783 build(deps): bump actions/create-github-app-token from 1.11.1 to 1.11.3
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.1 to 1.11.3.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](c1a285145b...67e27a7eb7)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 11:50:07 +00:00
Zhong Jianxin
973017d933 workflows/codeowners-v2: only run if github.repository_owner is NixOS
Failure on fork:

```
throw new Error("Input required and not supplied: app-id");
```
2025-01-11 21:14:39 +08:00
Wolfgang Walther
9ea74225cc workflows: add README
This introduces some basic concepts used in these workflows and a common
terminology.

At the same time we remove some of the comments from various workflow
files, because they are assumed to be "general knowledge" through the
README.
2025-01-10 18:36:22 +01:00
Wolfgang Walther
88afad8833 workflows: basic consistency in formatting workflows
Same top-level ordering of keys / empty lines and same indentation for
yaml lists. One blank line between each step.

Makes it easier to read and compare the workflows.
2025-01-09 21:29:41 +01:00
NAHO
fcfbe6fff4 workflows: update Ubuntu runner to ubuntu-24.04
Link: https://github.com/actions/runner-images/issues/10636
2025-01-05 00:18:58 +01:00
NAHO
2660dd1e71 workflows: lock Ubuntu runner to ubuntu-22.04
Lock the Ubuntu runner to ubuntu-22.04 to avoid accidental updates [1]
and increase reproducibility.

[1]: https://github.com/actions/runner-images/issues/10636
2025-01-05 00:18:57 +01:00
Wolfgang Walther
cf0616fec6 ci/request-reviews: rename code-owner related files
Now that we have maintainer reviews as well, be a bit more explicit
about naming.
2025-01-04 13:54:05 +01:00
Masum Reza
a69bc54e33 workflows/eval: Request reviews from changed package maintainers (#366046) 2025-01-02 14:18:57 +05:30
dependabot[bot]
4c4e9337fa build(deps): bump actions/create-github-app-token from 1.11.0 to 1.11.1
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](5d869da34e...c1a285145b)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 11:04:57 +00:00
Silvan Mosberger
b9d800d468 workflows/eval: Request reviews from changed package maintainers
Currently we need to rely on ofborg requesting reviews from package
maintainers, which takes a while with ofborg's eval queue. Since
recently we're doing faster evaluations with GitHub Actions, which contain all
necessary information to determine reviewers of changed packages the
same way ofborg does. This PR takes advantage of that.
2024-12-18 22:13:37 +01:00
Silvan Mosberger
83d4c9d28d workflows: Condition all merge-dependent workflows on a merge commit
After the introduction of the reusable get-merge-commit.yml workflow,
this now applies it on all remaining workflows that depend on a merge
commit. This ensures that CI doesn't fail for those PRs, which would
cause notifications to be sent, and the CI run to be marked as failed in
the list of runs.
2024-12-11 20:50:38 +01:00
dependabot[bot]
6baeff261f build(deps): bump actions/checkout from 4.2.1 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](eef61447b9...11bd71901b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 11:50:56 +00:00
Silvan Mosberger
5bbbc3a30b workflows: Rename after security fixes
In the previous two commits, security issues with these workflows were
fixed. In order for these to not be exploitable for PRs to branches that
don't have the fixes yet (including read-only branches like
nixos-unstable), these workflows are renamed, so that the old ones can
be turned off manually via GitHub interface.

Co-Authored-By: 13x1 <tori@disroot.org>
Co-Authored-By: basti564 <e3e@disroot.org>
2024-10-26 15:30:52 +02:00