diff --git a/.github/workflows/tag-validation.yml b/.github/workflows/tag-validation.yml new file mode 100644 index 0000000..c2cb145 --- /dev/null +++ b/.github/workflows/tag-validation.yml @@ -0,0 +1,28 @@ +name: test + +on: + pull_request_target: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Bun + uses: xhyrom/setup-bun@v0.1.3 + with: + bun-version: latest + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get changed files + uses: Mineflash07/gh-action-get-changed-files@feature/support-pr-target-event + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Add json + run: cp $HOME/files.json ./scripts/validateTags/ + + - name: Validate tags + run: bun run validate diff --git a/scripts/validateTags/package.json b/scripts/validateTags/package.json new file mode 100644 index 0000000..d263880 --- /dev/null +++ b/scripts/validateTags/package.json @@ -0,0 +1,6 @@ +{ + "name": "validate-tags", + "scripts": { + "start": "bun src/index.ts" + } +} \ No newline at end of file diff --git a/scripts/validateTags/src/index.ts b/scripts/validateTags/src/index.ts new file mode 100644 index 0000000..9d16e98 --- /dev/null +++ b/scripts/validateTags/src/index.ts @@ -0,0 +1,4 @@ +const files = await Bun.file('./files.json').text(); +console.log(files); + +export { }; diff --git a/scripts/validateTags/tsconfig.json b/scripts/validateTags/tsconfig.json new file mode 100644 index 0000000..6e28d70 --- /dev/null +++ b/scripts/validateTags/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "lib": ["ESNext"], + "module": "esnext", + "target": "esnext", + "moduleResolution": "Node", + // "bun-types" is the important part + "types": ["bun-types"] + } +} \ No newline at end of file