Skip to content

Commit

Permalink
Bump @octokit/rest from 20.1.1 to 21.0.2 (#35)
Browse files Browse the repository at this point in the history
* Bump @octokit/rest from 20.1.1 to 21.0.2

Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 20.1.1 to 21.0.2.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](octokit/rest.js@v20.1.1...v21.0.2)

---
updated-dependencies:
- dependency-name: "@octokit/rest"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Switch to ESM

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paul Schütte <paul.schuette@otto.de>
  • Loading branch information
dependabot[bot] and hanseartic authored Dec 16, 2024
1 parent 2dc597c commit fa45e8b
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
node-version: ${{ matrix.version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: ./
with:
token: ${{ github.token }}
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const core = require('@actions/core');
const github = require('@actions/github');
const { Octokit } = require('@octokit/rest');
const { extract: extractOlderThanInMs, filterWorkflowRuns: filterWorkflowRunsOlderThan} = require('./process_older_than');
import core from '@actions/core';
import github from '@actions/github';
import { Octokit } from '@octokit/rest';
import { extract as extractOlderThanInMs, filterWorkflowRuns as filterWorkflowRunsOlderThan} from './process_older_than.js';

const getInput = (name, fallback = undefined, extractor = (data) => data) => {
try {
Expand Down
196 changes: 174 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "purge-deprecated-workflow-runs",
"description": "Delete github workflow runs that don't have a corresponding workflow (anymore) from the current repository. Optionally delete cancelled, failed or skipped workflow runs.",
"main": "dist/index.js",
"type": "module",
"scripts": {
"build": "npx @vercel/ncc build",
"postbuild": "sed 's+index.js+dist/index.js+g' action.yml > action.yml.built && mv action.yml.built action.yml",
Expand All @@ -21,7 +22,7 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@octokit/rest": "^20.1.1"
"@octokit/rest": "^21.0.2"
},
"devDependencies": {
"jest": "^29.7.0"
Expand Down
9 changes: 2 additions & 7 deletions process_older_than.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const durationUnitToMs = {
y: 31536000000,
}

const extract = (data) => {
export const extract = (data) => {
const [since, ...nameSlices] = data.split(' ')
const workflowName = nameSlices.length
? nameSlices.join(' ')
Expand All @@ -26,7 +26,7 @@ const extract = (data) => {
}
}

const filterWorkflowRuns = (workflowRuns, extractedOlderThanList) => {
export const filterWorkflowRuns = (workflowRuns, extractedOlderThanList) => {
const now = new Date()
const olderThan = extractedOlderThanList
.map((since) => ({
Expand All @@ -44,8 +44,3 @@ const filterWorkflowRuns = (workflowRuns, extractedOlderThanList) => {
})
)
}

module.exports = {
extract,
filterWorkflowRuns,
}

0 comments on commit fa45e8b

Please sign in to comment.