Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format Docs #1632

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 22 additions & 21 deletions CODE_OF_CONDUCT.md
Expand Up @@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand All @@ -55,22 +55,23 @@ a project may be further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at opensource@github.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
reported by contacting the project team at
[`opensource@github.com`](mailto:opensource@github.com). All complaints will be
reviewed and investigated and will result in a response that is deemed necessary
and appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details of
specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
This Code of Conduct is adapted from the
[Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
available
[here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
For answers to common questions about this code of conduct, see the
[FAQ](https://www.contributor-covenant.org/faq).
2 changes: 1 addition & 1 deletion LICENSE.md
Expand Up @@ -6,4 +6,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
193 changes: 57 additions & 136 deletions README.md
@@ -1,226 +1,147 @@
<!-- markdownlint-disable MD033 MD041 -->

<p align="center">
<img src="res/at-logo.png">
<img alt="Logo" src="res/at-logo.png">
</p>

<p align="center">
<a href="https://github.com/actions/toolkit/actions?query=workflow%3Atoolkit-unit-tests"><img alt="Toolkit unit tests status" src="https://github.com/actions/toolkit/workflows/toolkit-unit-tests/badge.svg"></a>
<a href="https://github.com/actions/toolkit/actions?query=workflow%3Atoolkit-audit"><img alt="Toolkit audit status" src="https://github.com/actions/toolkit/workflows/toolkit-audit/badge.svg"></a>
</p>


## GitHub Actions Toolkit

The GitHub Actions ToolKit provides a set of packages to make creating actions easier.
The GitHub Actions Toolkit provides a set of packages to make creating actions easier.

<br/>
<h3 align="center">Get started with the <a href="https://github.com/actions/javascript-action">javascript-action template</a>!</h3>
<br/>
<h3 align="center">
Get started with the <a href="https://github.com/actions/typescript-action">TypeScript Action Template</a>!
</h3>

## Packages

:heavy_check_mark: [@actions/core](packages/core)
### :heavy_check_mark: [@actions/core](packages/core)

Provides functions for inputs, outputs, results, logging, secrets and variables. Read more [here](packages/core)
Provides functions for managing inputs, outputs, results, logging, secrets and variables.

```bash
$ npm install @actions/core
npm install @actions/core
```
<br/>

:runner: [@actions/exec](packages/exec)
### :runner: [@actions/exec](packages/exec)

Provides functions to exec cli tools and process output. Read more [here](packages/exec)
Provides functions to run CLI tools and process output.

```bash
$ npm install @actions/exec
npm install @actions/exec
```
<br/>

:ice_cream: [@actions/glob](packages/glob)
### :ice_cream: [@actions/glob](packages/glob)

Provides functions to search for files matching glob patterns. Read more [here](packages/glob)
Provides functions to search for files matching glob patterns.

```bash
$ npm install @actions/glob
npm install @actions/glob
```
<br/>

:phone: [@actions/http-client](packages/http-client)
### :phone: [@actions/http-client](packages/http-client)

A lightweight HTTP client optimized for building actions. Read more [here](packages/http-client)
Provides a lightweight HTTP client optimized for building actions.

```bash
$ npm install @actions/http-client
npm install @actions/http-client
```
<br/>

:pencil2: [@actions/io](packages/io)
### :pencil2: [@actions/io](packages/io)

Provides disk i/o functions like cp, mv, rmRF, which etc. Read more [here](packages/io)
Provides disk I/O functions like `cp`, `mv`, `rmRF`, `which`, etc.

```bash
$ npm install @actions/io
npm install @actions/io
```
<br/>

:hammer: [@actions/tool-cache](packages/tool-cache)

Provides functions for downloading and caching tools. e.g. setup-* actions. Read more [here](packages/tool-cache)
### :hammer: [@actions/tool-cache](packages/tool-cache)

See @actions/cache for caching workflow dependencies.
Provides functions for downloading and caching tools (e.g. `setup-*` actions). See [`@actions/cache`](packages/cache) for caching workflow dependencies.

```bash
$ npm install @actions/tool-cache
npm install @actions/tool-cache
```
<br/>

:octocat: [@actions/github](packages/github)
### :octocat: [@actions/github](packages/github)

Provides an Octokit client hydrated with the context that the current action is being run in. Read more [here](packages/github)
Provides an Octokit client hydrated with the context of the current workflow run.

```bash
$ npm install @actions/github
npm install @actions/github
```
<br/>

:floppy_disk: [@actions/artifact](packages/artifact)
### :floppy_disk: [@actions/artifact](packages/artifact)

Provides functions to interact with actions artifacts. Read more [here](packages/artifact)
Provides functions to interact with artifacts.

```bash
$ npm install @actions/artifact
npm install @actions/artifact
```
<br/>

:dart: [@actions/cache](packages/cache)
### :dart: [@actions/cache](packages/cache)

Provides functions to cache dependencies and build outputs to improve workflow execution time. Read more [here](packages/cache)
Provides functions to cache dependencies and build outputs to improve workflow run duration.

```bash
$ npm install @actions/cache
npm install @actions/cache
```
<br/>

## Creating an Action with the Toolkit
## Creating Custom GitHub Actions

:question: [Choosing an action type](docs/action-types.md)
:question: [Types of actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#types-of-actions)

Outlines the differences and why you would want to create a JavaScript or a container based action.
<br/>
<br/>
You can build Docker container, JavaScript, and composite actions.

:curly_loop: [Versioning](docs/action-versioning.md)
:curly_loop: [Using release management for actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-release-management-for-actions)

Actions are downloaded and run from the GitHub graph of repos. This contains guidance for versioning actions and safe releases.
<br/>
<br/>
This section explains how you can use release management to distribute updates to your actions in a predictable way.

:warning: [Problem Matchers](docs/problem-matchers.md)

Problem Matchers are a way to scan the output of actions for a specified regex pattern and surface that information prominently in the UI.
<br/>
<br/>

:warning: [Proxy Server Support](docs/proxy-support.md)
Problem Matchers are a way to scan the output of actions for a specified regular expression pattern and surface that information prominently in the UI.

Self-hosted runners can be configured to run behind proxy servers.
<br/>
<br/>
:warning: [Using a proxy server with self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners)

<h3><a href="https://github.com/actions/hello-world-javascript-action">Hello World JavaScript Action</a></h3>
You can configure self-hosted runners to use a proxy server to communicate with GitHub.

Illustrates how to create a simple hello world javascript action.
## Templates and Examples

```javascript
...
const nameToGreet = core.getInput('who-to-greet');
console.log(`Hello ${nameToGreet}!`);
...
```
<br/>

<h3><a href="https://github.com/actions/javascript-action">JavaScript Action Walkthrough</a></h3>
### [`actions/typescript-action`](https://github.com/actions/typescript-action)

Walkthrough and template for creating a JavaScript Action with tests, linting, workflow, publishing, and versioning.
Template action written in TypeScript with compilation, tests, linting, publishing, and versioning.

```javascript
async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
...
```
```javascript
PASS ./index.test.js
✓ throws invalid number
✓ wait 500 ms
✓ test runs

Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
```
<br/>
### [`action/javascript-action`](https://github.com/actions/javascript-action)

<h3><a href="https://github.com/actions/typescript-action">TypeScript Action Walkthrough</a></h3>
Template action written in JavaScript with compilation, tests, linting, publishing, and versioning.

Walkthrough creating a TypeScript Action with compilation, tests, linting, workflow, publishing, and versioning.
### [`actions/container-action`](https://github.com/actions/container-action)

```javascript
import * as core from '@actions/core';
Template action deployed as a Docker conatiner with compilation, tests, linting, publishing, and versioning.

async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
...
```
```javascript
PASS ./index.test.js
✓ throws invalid number
✓ wait 500 ms
✓ test runs

Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
```
<br/>
<br/>
### [`actions/container-toolkit-action`](https://github.com/actions/container-toolkit-action)

<h3><a href="docs/container-action.md">Docker Action Walkthrough</a></h3>
Template action deployed as a Docker conatiner with compilation, tests, linting, publishing, and versioning. Demonstrates using the GitHub Actions Toolkit within custom actions.

Create an action that is delivered as a container and run with docker.
### [`actions/container-prebuilt-action`](https://github.com/actions/container-prebuilt-action)

```docker
FROM alpine:3.10
COPY LICENSE README.md /
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
```
<br/>
Template action deployed as a Docker conatiner with compilation, tests, linting, publishing, and versioning. Demonstrates reduced workflow run duration using prebuilt container images.

<h3><a href="https://github.com/actions/container-toolkit-action">Docker Action Walkthrough with Octokit</a></h3>
### [`actions/hello-world-javascript-action`](https://github.com/actions/hello-world-javascript-action)

Create an action that is delivered as a container which uses the toolkit. This example uses the GitHub context to construct an Octokit client.
Illustrates how to create a simple _Hello, World!_ action written in JavaScript.

```docker
FROM node:slim
COPY . .
RUN npm install --production
ENTRYPOINT ["node", "/lib/main.js"]
```
```javascript
const myInput = core.getInput('myInput');
core.debug(`Hello ${myInput} from inside a container`);
### [`actions/hello-world-docker-action`](https://github.com/actions/hello-world-docker-action)

const context = github.context;
console.log(`We can even get context data, like the repo: ${context.repo.repo}`)
```
<br/>
Illustrates how to create a simple _Hello, World!_ action written as a Docker container.

## Contributing

We welcome contributions. See [how to contribute](.github/CONTRIBUTING.md).
We welcome contributions! See [how to contribute](.github/CONTRIBUTING.md).

## Code of Conduct

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
@@ -1,3 +1,3 @@
If you discover a security issue in this repo, please submit it through the [GitHub Security Bug Bounty](https://hackerone.com/github)

Thanks for helping make GitHub Actions safe for everyone.
Thanks for helping make GitHub Actions safe for everyone.
31 changes: 0 additions & 31 deletions docs/action-debugging.md

This file was deleted.