Skip to content

Commit

Permalink
Merge pull request #1 from pre-commit-ci/initial
Browse files Browse the repository at this point in the history
initial commit
  • Loading branch information
asottile authored Oct 13, 2024
2 parents 6818b84 + 376adf1 commit b6013a2
Show file tree
Hide file tree
Showing 8 changed files with 1,866 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions/internal/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: (internal)
description: (internal)
inputs:
name:
required: true
file:
required: true
runs:
using: node20
main: main.mjs
4 changes: 4 additions & 0 deletions .github/actions/internal/main.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import child_process from 'child_process';

const args = ['dist/index.js', process.env.INPUT_NAME, process.env.INPUT_FILE];
child_process.execFileSync('node', args, {stdio: 'inherit'});
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request:
push:
branches: [main, test-me-*]

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm i
- run: npm run package
- uses: ./.github/actions/internal
with:
name: dist
file: dist/index.js
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
/node_modules
13 changes: 13 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {DefaultArtifactClient} from '@actions/artifact'

if (process.argv.length < 4) {
console.error('usage `upload-artifact-cli artifact-name file [file ...]`');
process.exit(1);
}

await new DefaultArtifactClient().uploadArtifact(
process.argv[2],
process.argv.slice(3),
'.',
{retentionDays: 1}
);
Loading

0 comments on commit b6013a2

Please sign in to comment.