Skip to content

Commit fbd6a39

Browse files
authored
Merge pull request #3 from actions/sgoedecke/initial-setup
Setup initial inference flow and install packages
2 parents 0905e36 + 9c5c91f commit fbd6a39

File tree

17 files changed

+6741
-377
lines changed

17 files changed

+6741
-377
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ACTIONS_STEP_DEBUG=true
99

1010
# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
1111
# Hyphens should not be converted to underscores!
12-
INPUT_MILLISECONDS=2400
12+
INPUT_PROMPT=hello
1313

1414
# GitHub Actions default environment variables. These are set for every run of a
1515
# workflow and can be used in your actions. Setting the value here will override

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
permissions:
1212
contents: read
13+
models: read
1314

1415
jobs:
1516
test-typescript:
@@ -43,6 +44,8 @@ jobs:
4344
- name: Test
4445
id: npm-ci-test
4546
run: npm run ci-test
47+
env:
48+
GITHUB_TOKEN: ${{ github.token }}
4649

4750
test-action:
4851
name: GitHub Actions Test
@@ -57,8 +60,10 @@ jobs:
5760
id: test-action
5861
uses: ./
5962
with:
60-
milliseconds: 2000
63+
prompt: hello
64+
env:
65+
GITHUB_TOKEN: ${{ github.token }}
6166

6267
- name: Print Output
6368
id: output
64-
run: echo "${{ steps.test-action.outputs.time }}"
69+
run: echo "${{ steps.test-action.outputs.response }}"

.github/workflows/licensed.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ on:
88
# Uncomment the below lines to run this workflow on pull requests and pushes
99
# to the default branch. This is useful for checking licenses before merging
1010
# changes into the default branch.
11-
# pull_request:
12-
# branches:
13-
# - main
14-
# push:
15-
# branches:
16-
# - main
11+
pull_request:
12+
branches:
13+
- main
14+
push:
15+
branches:
16+
- main
1717
workflow_dispatch:
1818

1919
permissions:

.github/workflows/linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ jobs:
5151
VALIDATE_TYPESCRIPT_ES: false
5252
VALIDATE_JSON: false
5353
VALIDATE_TYPESCRIPT_STANDARD: false
54+
VALIDATE_GITHUB_ACTIONS: false # false until linter schemas are updated to include the models permission

CODE_OF_CONDUCT.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and
9+
expression, level of experience, education, socio-economic status, nationality,
10+
personal appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or reject
41+
comments, commits, code, wiki edits, issues, and other contributions that are
42+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
43+
contributor for other behaviors that they deem inappropriate, threatening,
44+
offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project email address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at `[email protected]`. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an
62+
incident. Further details of specific enforcement policies may be posted
63+
separately.
64+
65+
Project maintainers who do not follow or enforce the Code of Conduct in good
66+
faith may face temporary or permanent repercussions as determined by other
67+
members of the project's leadership.
68+
69+
## Attribution
70+
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
72+
version 1.4, available at
73+
`https://www.contributor-covenant.org/version/1/4/code-of-conduct.html`
74+
75+
[homepage]: `https://www.contributor-covenant.org`
76+
77+
For answers to common questions about this code of conduct, see
78+
`https://www.contributor-covenant.org/faq`

CONTRIBUTING.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Contributing
2+
3+
[fork]: https://github.com/actions/ai-inference/fork
4+
[pr]: https://github.com/actions/ai-inference/compare
5+
[code-of-conduct]: CODE_OF_CONDUCT.md
6+
7+
Hi there! We're thrilled that you'd like to contribute to this project. Your
8+
help is essential for keeping it great.
9+
10+
Contributions to this project are
11+
[released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license)
12+
to the public under the [project's open source license](LICENSE).
13+
14+
Please note that this project is released with a [Contributor Code of
15+
Conduct][code-of-conduct]. By participating in this project you agree to abide
16+
by its terms.
17+
18+
## Found a bug?
19+
20+
- **Ensure the bug was not already reported** by searching on GitHub under
21+
[Issues](https://github.com/actions/ai-inference/issues).
22+
- If you're unable to find an open issue addressing the problem,
23+
[open a new one](https://github.com/actions/ai-inference/issues/new). Be sure
24+
to include a **title and clear description**, as much relevant information as
25+
possible, and a **code sample** or a **reproducible test case** demonstrating
26+
the expected behavior that is not occurring.
27+
- If possible, use the relevant bug report templates to create the issue.
28+
29+
## What should I know before submitting a pull request or issue
30+
31+
This project is written in [TypeScript](https://www.typescriptlang.org/), a
32+
typed variant of JavaScript, and we use [Prettier](https://prettier.io/) to get
33+
a consistent code style.
34+
35+
Because of how GitHub Actions are run, the source code of this project is
36+
transpiled from TypeScript into JavaScript. The transpiled code (found in
37+
`lib/`) is subsequently compiled using
38+
[NCC](https://github.com/vercel/ncc/blob/master/readme.md) (found in `dist/`) to
39+
avoid having to include the `node_modules/` directory in the repository.
40+
41+
## Submitting a pull request
42+
43+
1. [Fork][fork] and clone the repository
44+
1. Configure and install the dependencies: `npm install`
45+
1. Create a new branch: `git checkout -b my-branch-name`
46+
1. Make your change, add tests, and make sure the tests still pass:
47+
`npm run test`
48+
1. Make sure your code is correctly formatted: `npm run format`
49+
1. Update `dist/index.js` using `npm run build`. This creates a single
50+
JavaScript file that is used as an entrypoint for the action
51+
1. Push to your fork and [submit a pull request][pr]
52+
1. Pat yourself on the back and wait for your pull request to be reviewed and
53+
merged.
54+
55+
Here are a few things you can do that will increase the likelihood of your pull
56+
request being accepted:
57+
58+
- Write tests.
59+
- Keep your change as focused as possible. If there are multiple changes you
60+
would like to make that are not dependent upon each other, consider submitting
61+
them as separate pull requests.
62+
63+
## Releasing a new version
64+
65+
All the concepts from
66+
[the actions/toolkit release docs](https://github.com/actions/toolkit/blob/main/docs/action-versioning.md)
67+
apply. Please read that first!
68+
69+
Once the changes are merged into main, a repository maintainer should:
70+
71+
1. Bump the package version by running
72+
[`npm version [major|minor|patch]`](https://docs.npmjs.com/cli/v7/commands/npm-version).
73+
We adhere to [SemVer 2.0](https://semver.org/spec/v2.0.0.html) to the best of
74+
our ability. Commit the changes to `package.json` and `package-lock.json` and
75+
push them to main.
76+
1. [Draft a new release](https://github.com/actions/ai-inference/releases/new)
77+
pointing to the ref of the version bump you just made. Publish the release to
78+
the marketplace when complete.
79+
1. Finally: update the corresponding "major tag" (v1, v2, v3, etc) to point to
80+
the specific ref of the release you just made. For example, if we just
81+
released `v1.1.0`, we would rewrite the `v1` tag like this:
82+
83+
```bash
84+
git tag -fa v1 v1.1.0 -m "Update v1 tag to point to v1.1.0"
85+
git push origin v1 --force
86+
```
87+
88+
## Licensed
89+
90+
This repository uses a tool called
91+
[Licensed](https://github.com/github/licensed) to verify third party
92+
dependencies. You may need to locally install licensed and run `licensed cache`
93+
to update the dependency cache if you install or update a production dependency.
94+
If licensed cache is unable to determine the dependency, you may need to modify
95+
the cache file yourself to put the correct license. You should still verify the
96+
dependency, licensed is a tool to help, but is not a substitute for human review
97+
of dependencies.
98+
99+
## Resources
100+
101+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
102+
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
103+
- [GitHub Help](https://help.github.com)
104+
- [Writing good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
105+
106+
Thanks! :heart: :heart: :heart:
107+
108+
GitHub Actions Team :octocat:

0 commit comments

Comments
 (0)