Skip to content

Commit c58c143

Browse files
committed
Copy more files over
1 parent ff5ce3f commit c58c143

File tree

13 files changed

+52646
-0
lines changed

13 files changed

+52646
-0
lines changed

.github/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
actions-minor:
9+
update-types:
10+
- minor
11+
- patch
12+
13+
- package-ecosystem: npm
14+
directory: /
15+
schedule:
16+
interval: weekly
17+
ignore:
18+
- dependency-name: '@types/node'
19+
update-types:
20+
- 'version-update:semver-major'
21+
groups:
22+
npm-development:
23+
dependency-type: development
24+
update-types:
25+
- minor
26+
- patch
27+
npm-production:
28+
dependency-type: production
29+
update-types:
30+
- patch

.github/workflows/check-dist.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# In TypeScript actions, `dist/` is a special directory. When you reference
2+
# an action with the `uses:` property, `dist/index.js` is the code that will be
3+
# run. For this project, the `dist/index.js` file is transpiled from other
4+
# source files. This workflow ensures the `dist/` directory contains the
5+
# expected transpiled code.
6+
#
7+
# If this workflow is run from a feature branch, it will act as an additional CI
8+
# check and fail if the checked-in `dist/` directory does not match what is
9+
# expected from the build.
10+
name: Check Transpiled JavaScript
11+
12+
on:
13+
pull_request:
14+
branches:
15+
- main
16+
push:
17+
branches:
18+
- main
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
check-dist:
25+
name: Check dist/
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout
30+
id: checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
id: setup-node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version-file: .node-version
38+
cache: npm
39+
40+
- name: Install Dependencies
41+
id: install
42+
run: npm ci
43+
44+
- name: Build dist/ Directory
45+
id: build
46+
run: npm run bundle
47+
48+
# This will fail the workflow if the `dist/` directory is different than
49+
# expected.
50+
- name: Compare Directories
51+
id: diff
52+
run: |
53+
if [ ! -d dist/ ]; then
54+
echo "Expected dist/ directory does not exist. See status below:"
55+
ls -la ./
56+
exit 1
57+
fi
58+
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
59+
echo "Detected uncommitted changes after build. See status below:"
60+
git diff --ignore-space-at-eol --text dist/
61+
exit 1
62+
fi
63+
64+
# If `dist/` was different than expected, upload the expected version as a
65+
# workflow artifact.
66+
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
67+
name: Upload Artifact
68+
id: upload
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: dist
72+
path: dist/

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
models: read
14+
15+
jobs:
16+
test-typescript:
17+
name: TypeScript Tests
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
id: checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
id: setup-node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version-file: .node-version
30+
cache: npm
31+
32+
- name: Install Dependencies
33+
id: npm-ci
34+
run: npm ci
35+
36+
- name: Check Format
37+
id: npm-format-check
38+
run: npm run format:check
39+
40+
- name: Lint
41+
id: npm-lint
42+
run: npm run lint
43+
44+
- name: Test
45+
id: npm-ci-test
46+
run: npm run ci-test
47+
env:
48+
GITHUB_TOKEN: ${{ github.token }}
49+
50+
test-action:
51+
name: GitHub Actions Test
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout
56+
id: checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Test Local Action
60+
id: test-action
61+
continue-on-error: true
62+
uses: ./
63+
with:
64+
prompt: hello
65+
env:
66+
GITHUB_TOKEN: ${{ github.token }}
67+
68+
- name: Print Output
69+
id: output
70+
continue-on-error: true
71+
run: echo "${{ steps.test-action.outputs.response }}"
72+
73+
test-action-prompt-file:
74+
name: GitHub Actions Test with Prompt File
75+
runs-on: ubuntu-latest
76+
77+
steps:
78+
- name: Checkout
79+
id: checkout
80+
uses: actions/checkout@v4
81+
82+
- name: Create Prompt File
83+
run: echo "hello" > prompt.txt
84+
85+
- name: Create System Prompt File
86+
run:
87+
echo "You are a helpful AI assistant for testing." > system-prompt.txt
88+
89+
- name: Test Local Action with Prompt File
90+
id: test-action-prompt-file
91+
continue-on-error: true
92+
uses: ./
93+
with:
94+
prompt-file: prompt.txt
95+
system-prompt-file: system-prompt.txt
96+
env:
97+
GITHUB_TOKEN: ${{ github.token }}
98+
99+
- name: Print Output
100+
continue-on-error: true
101+
run: |
102+
echo "Response saved to: ${{ steps.test-action-prompt-file.outputs.response-file }}"
103+
cat "${{ steps.test-action-prompt-file.outputs.response-file }}"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '31 7 * * 3'
12+
13+
permissions:
14+
actions: read
15+
checks: write
16+
contents: read
17+
security-events: write
18+
19+
jobs:
20+
analyze:
21+
name: Analyze
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language:
28+
- TypeScript
29+
30+
steps:
31+
- name: Checkout
32+
id: checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
id: initialize
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
source-root: src
41+
42+
- name: Autobuild
43+
id: autobuild
44+
uses: github/codeql-action/autobuild@v3
45+
46+
- name: Perform CodeQL Analysis
47+
id: analyze
48+
uses: github/codeql-action/analyze@v3

.github/workflows/licensed.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow checks the statuses of cached dependencies used in this action
2+
# with the help of the Licensed tool. If any licenses are invalid or missing,
3+
# this workflow will fail. See: https://github.com/licensee/licensed
4+
5+
name: Licensed
6+
7+
on:
8+
# Uncomment the below lines to run this workflow on pull requests and pushes
9+
# to the default branch. This is useful for checking licenses before merging
10+
# changes into the default branch.
11+
pull_request:
12+
branches:
13+
- main
14+
push:
15+
branches:
16+
- main
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: write
21+
22+
jobs:
23+
licensed:
24+
name: Check Licenses
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout
29+
id: checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
id: setup-node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version-file: .node-version
37+
cache: npm
38+
39+
- name: Install Dependencies
40+
id: npm-ci
41+
run: npm ci
42+
43+
- name: Setup Ruby
44+
id: setup-ruby
45+
uses: ruby/setup-ruby@v1
46+
with:
47+
ruby-version: ruby
48+
49+
- uses: licensee/[email protected]
50+
with:
51+
version: 4.x
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
54+
# If this is a workflow_dispatch event, update the cached licenses.
55+
- if: ${{ github.event_name == 'workflow_dispatch' }}
56+
name: Update Licenses
57+
id: update-licenses
58+
run: licensed cache
59+
60+
# Then, commit the updated licenses to the repository.
61+
- if: ${{ github.event_name == 'workflow_dispatch' }}
62+
name: Commit Licenses
63+
id: commit-licenses
64+
run: |
65+
git config --local user.email "[email protected]"
66+
git config --local user.name "licensed-ci"
67+
git add .
68+
git commit -m "Auto-update license files"
69+
git push
70+
71+
# Last, check the status of the cached licenses.
72+
- name: Check Licenses
73+
id: check-licenses
74+
run: licensed status

.github/workflows/linter.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Lint Codebase
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
16+
jobs:
17+
lint:
18+
name: Lint Codebase
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
id: checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Node.js
29+
id: setup-node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version-file: .node-version
33+
cache: npm
34+
35+
- name: Install Dependencies
36+
id: install
37+
run: npm ci
38+
39+
- name: Lint Codebase
40+
id: super-linter
41+
uses: super-linter/super-linter/slim@5119dcd8011e92182ce8219d9e9efc82f16fddb6
42+
env:
43+
DEFAULT_BRANCH: main
44+
FILTER_REGEX_EXCLUDE: dist/**/*
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
LINTER_RULES_PATH: ${{ github.workspace }}
47+
VALIDATE_ALL_CODEBASE: true
48+
VALIDATE_JAVASCRIPT_ES: false
49+
VALIDATE_JAVASCRIPT_STANDARD: false
50+
VALIDATE_JSCPD: false
51+
VALIDATE_TYPESCRIPT_ES: false
52+
VALIDATE_JSON: false
53+
VALIDATE_TYPESCRIPT_STANDARD: false
54+
VALIDATE_GITHUB_ACTIONS: false # false until linter schemas are updated to include the models permission

0 commit comments

Comments
 (0)