|
| 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