ci/github-script: move from ci/labels

This just moves things around to use less specific naming - `labels` is
only *one* script that can potentially be run locally while still being
written in github-script. Later, we can add more.
This commit is contained in:
Wolfgang Walther
2025-07-12 15:24:14 +02:00
parent b2e5044b3e
commit 6f6c625026
11 changed files with 16 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: |
ci/labels
ci/github-script
- name: Install dependencies
run: npm install @actions/artifact bottleneck
@@ -69,7 +69,7 @@ jobs:
github-token: ${{ steps.app-token.outputs.token || github.token }}
retries: 3
script: |
require('./ci/labels/labels.cjs')({
require('./ci/github-script/labels.cjs')({
github,
context,
core,

View File

@@ -0,0 +1,13 @@
# GitHub specific CI scripts
This folder contains [`actions/github-script`](https://github.com/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:
- Provide `gh` on `PATH` and make sure it's authenticated.
- Enter `nix-shell` in `./ci/github-script`.
## Labeler
Run `./run.js OWNER REPO`, where OWNER is your username or "NixOS" and REPO the name of your fork or "nixpkgs".

View File

@@ -7,7 +7,7 @@ import { getOctokit } from '@actions/github'
import labels from './labels.cjs'
if (process.argv.length !== 4)
throw new Error('Call this with exactly two arguments: ./run.js OWNER REPO')
throw new Error('Call this with exactly three arguments: ./run OWNER REPO')
const [, , owner, repo] = process.argv
const token = execSync('gh auth token', { encoding: 'utf-8' }).trim()

View File

@@ -1,4 +0,0 @@
To test the labeler locally:
- Provide `gh` on `PATH` and make sure it's authenticated.
- Enter `nix-shell` in `./ci/labels`.
- Run `./run.js OWNER REPO`, where OWNER is your username or "NixOS" and REPO the name of your fork or "nixpkgs".