mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
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:
4
.github/workflows/labels.yml
vendored
4
.github/workflows/labels.yml
vendored
@@ -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,
|
||||
|
||||
13
ci/github-script/README.md
Normal file
13
ci/github-script/README.md
Normal 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".
|
||||
@@ -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()
|
||||
@@ -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".
|
||||
Reference in New Issue
Block a user