Compare commits

..

1 Commits

Author SHA1 Message Date
snyk-bot
8af748072c fix: upgrade @actions/core from 1.10.1 to 1.11.1
Snyk has created this PR to upgrade @actions/core from 1.10.1 to 1.11.1.

See this package in npm:
@actions/core

See this project in Snyk:
https://app.snyk.io/org/nick-invision/project/b960b937-66a3-4aae-9cb2-321f49c8750b?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-02-09 10:43:25 +00:00
7 changed files with 14025 additions and 10754 deletions

View File

@@ -1,15 +0,0 @@
name: Setup Node, PNPM, cache, and install dependencies
description: Sets up job to use the nodejs version in .nvmrc, pnpm, cache, and install dependencies
runs:
using: composite
steps:
- uses: pnpm/action-setup@v3
with:
version: 9.5.0
- uses: actions/setup-node@v4
with:
node-version-file: ./.nvmrc
cache: 'pnpm'
- run: pnpm install
shell: bash

View File

@@ -1,88 +1,26 @@
name: CI/CD
# PRs come in via the GitHub UI that skip pre-commit hooks which bundle the code. So we have to check that the code is bundled properly here and potentially re-commit if changes are found
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name == 'master' && false || true}}
on:
# only on PRs into and merge to default branch
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
branches:
- master
push:
branches:
- master
env:
BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
PR_TRIGGERED: ${{ github.event_name == 'pull_request' && github.event.action != 'labeled' }}
jobs:
setup:
# Skip running if labeled event but not rerun, otehrwise its a supported trigger event
if: ${{ github.event.label.name == 'rerun' || github.event.action != 'labeled' }}
name: Setup
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
- name: Setup and cache for later jobs
uses: ./.github/actions/setup
# GHA requires bundled code to be commited so we bundle automatically via pre-commit hook. However, most contributions come in through the GH UI which skips hooks.
# So bundle again here just in case, and if changes are found then commit them to ensure we're testing the correct code.
# But GHA does not trigger on changes made via the default GH token, so we need to label the PR to re-run CI.
# Alternatives could be using a PAT (rotation/security burden), GH App (overkill/maintenance), or something like pre-commit.ci (not convincing). Lets try this first though
- name: Check for bundle changes after install
# Only run if not a push event since we only trigger this on the default branch and we don't want to make any non-PR changes there
if: ${{ github.event_name != 'push' }}
id: changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "CHANGES_FOUND=true" >> $GITHUB_OUTPUT
else
echo "No changes detected."
echo "CHANGES_FOUND=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes if found
if: ${{ steps.changes.outputs.CHANGES_FOUND == 'true' }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "patch: regenerated bundle"
git push
- name: Label PR to re-trigger CI
if: ${{ steps.changes.outputs.CHANGES_FOUND == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "rerun"
- name: Remove label after clean re-run
# Only remove label if the PR was labeled with rerun and no changes were found. Changes found indicate a problem since they should have been previously committed
if: ${{ steps.changes.outputs.CHANGES_FOUND == 'false' && github.event.label.name == 'rerun' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ github.event.pull_request.number }} --remove-label "rerun"
ci_unit:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Run Unit Tests
run: npm test
- uses: codecov/codecov-action@v5
@@ -93,12 +31,15 @@ jobs:
ci_integration:
name: Run Integration Tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: happy-path
id: happy_path
@@ -200,12 +141,15 @@ jobs:
ci_integration_envvar:
name: Run Integration Env Var Tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: env-vars-passed-through
uses: ./
env:
@@ -218,12 +162,15 @@ jobs:
ci_integration_large_output:
name: Run Integration Large Output Tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Test 100MiB of output can be processed
id: large-output
continue-on-error: true
@@ -246,12 +193,15 @@ jobs:
ci_integration_retry_on_exit_code:
name: Run Integration retry_on_exit_code Tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: retry_on_exit_code (with expected error code)
id: retry_on_exit_code_expected
uses: ./
@@ -291,12 +241,15 @@ jobs:
ci_integration_continue_on_error:
name: Run Integration continue_on_error Tests
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: happy-path (continue_on_error)
id: happy_path_continue_on_error
uses: ./
@@ -335,12 +288,15 @@ jobs:
ci_integration_retry_wait_seconds:
name: Run Integration Tests (retry_wait_seconds)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: sad-path (retry_wait_seconds)
id: sad_path_wait_sec
@@ -368,12 +324,15 @@ jobs:
ci_integration_on_retry_cmd:
name: Run Integration Tests (on_retry_command)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: new-command-on-retry
id: new-command-on-retry
@@ -408,12 +367,15 @@ jobs:
ci_integration_timeout_seconds:
name: Run Integration Timeout Tests (seconds)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: sad-path (timeout)
id: sad_path_timeout
@@ -435,12 +397,15 @@ jobs:
ci_integration_timeout_retry_on_timeout:
name: Run Integration Timeout Tests (retry_on timeout)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: retry_on (timeout)
id: retry_on_timeout
@@ -463,12 +428,15 @@ jobs:
ci_integration_timeout_retry_on_error:
name: Run Integration Timeout Tests (retry_on error)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: retry_on (error) fails early if timeout encountered
id: retry_on_error_fail
@@ -495,12 +463,15 @@ jobs:
ci_integration_timeout_minutes:
name: Run Integration Timeout Tests (minutes)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: sad-path (timeout minutes)
id: sad_path_timeout_minutes
@@ -522,12 +493,15 @@ jobs:
ci_windows:
name: Run Windows Tests
runs-on: windows-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Powershell test
uses: ./
with:
@@ -598,8 +572,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Release
id: semantic
uses: cycjimmy/semantic-release-action@v4

3614
dist/index.js vendored

File diff suppressed because one or more lines are too long

12610
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,14 +3,12 @@
"version": "0.0.0-managed-by-semantic-release",
"description": "Retries a GitHub Action step on failure or timeout.",
"scripts": {
"bundle": "ncc build src/index.ts",
"lint:base": "eslint --config ./.config/.eslintrc.js ",
"lint": "pnpm lint:base -- .",
"local": "pnpm prepare && node -r dotenv/config ./dist/index.js",
"preinstall": "npx only-allow pnpm",
"prepare": "pnpm bundle && husky install",
"lint": "npm run lint:base -- .",
"local": "npm run prepare && node -r dotenv/config ./dist/index.js",
"prepare": "ncc build src/index.ts && husky install",
"style:base": "prettier --config ./.config/.prettierrc.yml --ignore-path ./.config/.prettierignore --write ",
"style": "pnpm style:base -- .",
"style": "npm run style:base -- .",
"test": "jest -c ./.config/jest.config.js"
},
"repository": {
@@ -25,7 +23,7 @@
},
"homepage": "https://github.com/nick-fields/retry#readme",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/core": "^1.11.1",
"milliseconds": "^1.0.3",
"tree-kill": "^1.2.2"
},

8334
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,8 +14,6 @@ const OUTPUT_EXIT_ERROR_KEY = 'exit_error';
let exit: number;
let done: boolean;
info('test');
function getExecutable(inputs: Inputs): string {
if (!inputs.shell) {
return OS === 'win32' ? 'powershell' : 'bash';