Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Oct 13, 2024
1 parent 6818b84 commit 376adf1
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 376adf1

Please sign in to comment.