Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuzakil authored Jan 30, 2025
2 parents 4a9aa33 + c2e9dc9 commit 01c1d18
Show file tree
Hide file tree
Showing 1,018 changed files with 146,955 additions and 3,338 deletions.
37 changes: 37 additions & 0 deletions .github/actions/setup-node-install-deps/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Setup Node and install dependencies
description: Uses specified Node version and installs dependencies (typically using "npm")

inputs:
node-version:
description: 'Node version to use'
default: 22.x
install-command:
description: 'Command to install dependencies'
default: 'npm ci'
working-directory:
description: 'Working directory'
default: '.'

runs:
using: "composite"

steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- run: |
echo "::group::$INSTALL_COMMAND"
$INSTALL_COMMAND
echo "::endgroup::"
shell: bash
env:
INSTALL_COMMAND: ${{ inputs.install-command }}
working-directory: ${{ inputs.working-directory }}
- run: |
echo "::group::npm ls -a"
npm ls -a || true
echo "::endgroup::"
shell: bash
working-directory: ${{ inputs.working-directory }}
27 changes: 0 additions & 27 deletions .github/actions/setup-node-npm-ci/action.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/actions/update-labels/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
using: composite

steps:
- name: Set Label
- name: Update Labels
uses: actions/github-script@v7
env:
OWNER: ${{ inputs.owner }}
Expand All @@ -29,5 +29,6 @@ runs:
RUN_ID: ${{ inputs.run_id }}
with:
script: |
const action = require('./.github/actions/update-labels/action.js')
await action({ github, context, core });
const { default: updateLabels } =
await import('${{ github.workspace }}/.github/actions/update-labels/src/update-labels.js');
await updateLabels({ github, context, core });
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @ts-check

const { extractInputs } = require("../context");
import { extractInputs } from "../../../src/context.js";

/**
* @param {import('github-script').AsyncFunctionArguments} AsyncFunctionArguments
*/
module.exports = async ({ github, context, core }) => {
export default async function updateLabels({ github, context, core }) {
let owner = process.env.OWNER;
let repo = process.env.REPO;
let issue_number = parseInt(process.env.ISSUE_NUMBER || "");
Expand All @@ -19,6 +19,26 @@ module.exports = async ({ github, context, core }) => {
run_id = run_id || inputs.run_id;
}

await updateLabelsImpl({ owner, repo, issue_number, run_id, github, core });
}

/**
* @param {Object} params
* @param {string} params.owner
* @param {string} params.repo
* @param {number} params.issue_number
* @param {number} params.run_id
* @param {(import("@octokit/core").Octokit & import("@octokit/plugin-rest-endpoint-methods/dist-types/types.js").Api & { paginate: import("@octokit/plugin-paginate-rest").PaginateInterface; })} params.github
* @param {typeof import("@actions/core")} params.core
*/
export async function updateLabelsImpl({
owner,
repo,
issue_number,
run_id,
github,
core,
}) {
/** @type {string[]} */
let artifactNames = [];

Expand Down Expand Up @@ -82,7 +102,7 @@ module.exports = async ({ github, context, core }) => {
}

if (labelsToRemove.length > 0) {
// Must loop over labelsToRemove ourselves, since GitHub doesn't expose a REST API to remove in bulk.
// Must loop over labelsToRemove ourselves, since GitHub doesn't expose a REST API to remove in bulk.
for (const name of labelsToRemove) {
try {
await github.rest.issues.removeLabel({
Expand All @@ -100,4 +120,4 @@ module.exports = async ({ github, context, core }) => {
}
}
}
};
}
Loading

0 comments on commit 01c1d18

Please sign in to comment.