Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/images/help/business-accounts/billing-license-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ For more information, see "[`github context`](/actions/reference/context-and-exp

##### **`runs.steps.env`**

**Optional** Sets a `map` of environment variables for only that step. If you want to modify the environment variable stored in the workflow, use `echo "::set-env name={name}::{value}"` in a composite run step.
**Optional** Sets a `map` of environment variables for only that step. If you want to modify the environment variable stored in the workflow, use {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}`echo "{name}={value}" >> $GITHUB_ENV`{% else %}`echo "::set-env name={name}::{value}"`{% endif %} in a composite run step.

##### **`runs.steps.working-directory`**

Expand Down
2 changes: 1 addition & 1 deletion content/actions/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ steps:
Last_Name: Octocat
```

You can also use the `set-env` workflow command to set an environment variable that the following steps in a workflow can use. The `set-env` command can be used directly by an action or as a shell command in a workflow file using the `run` keyword. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/reference/workflow-commands-for-github-actions/#setting-an-environment-variable)."
You can also use the {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}`GITHUB_ENV` environment file{% else %} `set-env` workflow command{% endif %} to set an environment variable that the following steps in a workflow can use. The {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}environment file{% else %} `set-env` command{% endif %} can be used directly by an action or as a shell command in a workflow file using the `run` keyword. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/reference/workflow-commands-for-github-actions/#setting-an-environment-variable)."

### Default environment variables

Expand Down
88 changes: 81 additions & 7 deletions content/actions/reference/workflow-commands-for-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ versions:

Actions can communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs, and other tasks.

{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
Most workflow commands use the `echo` command in a specific format, while others are invoked by writing to a file. For more information, see ["Environment files".](#environment-files)
{% else %}
Workflow commands use the `echo` command in a specific format.
{% endif %}

``` bash
echo "::workflow-command parameter1={data},parameter2={data}::{command value}"
Expand All @@ -41,30 +45,31 @@ echo "::workflow-command parameter1={data},parameter2={data}::{command value}"

### Using workflow commands to access toolkit functions

The [actions/toolkit](https://github.com/actions/toolkit) includes a number of functions that can be executed as workflow commands. Use the `::` syntax to run the workflow commands within your YAML file; these commands are then sent to the runner over `stdout`. For example, instead of using code to set an environment variable, as below:
The [actions/toolkit](https://github.com/actions/toolkit) includes a number of functions that can be executed as workflow commands. Use the `::` syntax to run the workflow commands within your YAML file; these commands are then sent to the runner over `stdout`. For example, instead of using code to set an output, as below:

```javascript
core.exportVariable('SELECTED_COLOR', 'green');
core.setOutput('SELECTED_COLOR', 'green');
```

You can use the `set-env` command in your workflow to set the same value:
You can use the `set-output` command in your workflow to set the same value:

``` yaml
- name: Set selected color
run: echo '::set-env name=SELECTED_COLOR::green'
run: echo '::set-output name=SELECTED_COLOR::green'
id: random-color-generator
- name: Get color
run: echo 'The selected color is' $SELECTED_COLOR
run: echo 'The selected color is' ${steps.random-color-generator.outputs.SELECTED_COLOR}
```

The following table shows which toolkit functions are available within a workflow:

| Toolkit function| Equivalent workflow command|
| ------------- | ------------- |
| `core.addPath` | `add-path` |
| `core.addPath` | {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}Accessible using environment file `GITHUB_PATH`{% else %} `add-path` {% endif %} |
| `core.debug` | `debug` |
| `core.error` | `error` |
| `core.endGroup` | `endgroup` |
| `core.exportVariable` | `set-env` |
| `core.exportVariable` | {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}Accessible using environment file `GITHUB_ENV`{% else %} `set-env` {% endif %} |
| `core.getInput` | Accessible using environment variable `INPUT_{NAME}` |
| `core.getState` | Accessible using environment variable `STATE_{NAME}` |
| `core.isDebug` | Accessible using environment variable `RUNNER_DEBUG` |
Expand All @@ -75,6 +80,7 @@ The following table shows which toolkit functions are available within a workflo
| `core.startGroup` | `group` |
| `core.warning` | `warning file` |

{% if currentVersion ver_lt "enterprise-server@2.23" %}
### Setting an environment variable

`::set-env name={name}::{value}`
Expand All @@ -86,6 +92,7 @@ Creates or updates an environment variable for any actions running next in a job
``` bash
echo "::set-env name=action_state::yellow"
```
{% endif %}

### Setting an output parameter

Expand All @@ -101,6 +108,7 @@ Optionally, you can also declare output parameters in an action's metadata file.
echo "::set-output name=action_fruit::strawberry"
```

{% if currentVersion ver_lt "enterprise-server@2.23" %}
### Adding a system path

`::add-path::{path}`
Expand All @@ -112,6 +120,7 @@ Prepends a directory to the system `PATH` variable for all subsequent actions in
``` bash
echo "::add-path::/path/to/dir"
```
{% endif %}

### Setting a debug message

Expand Down Expand Up @@ -213,3 +222,68 @@ The `STATE_processID` variable is then exclusively available to the cleanup scri
``` javascript
console.log("The running PID from the main action is: " + process.env.STATE_processID);
```

{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
## Environment Files

During the execution of a workflow, the runner generates temporary files that can be used to perform certain actions. The path to these files are exposed via environment variables. You will need to use UTF-8 encoding when writing to these files to ensure proper processing of the commands. Multiple commands can be written to the same file, separated by newlines.

{% warning %}

**Warning:** Powershell does not use UTF-8 by default. Make sure you write files using the correct encoding. For example, you need to set UTF-8 encoding when you set the path:

```
steps:
- run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
```

{% endwarning %}

### Setting an environment variable

`echo "{name}={value}" >> $GITHUB_ENV`

Creates or updates an environment variable for any actions running next in a job. The action that creates or updates the environment variable does not have access to the new value, but all subsequent actions in a job will have access. Environment variables are case-sensitive and you can include punctuation.

#### Example

```bash
echo "action_state=yellow" >> $GITHUB_ENV
```

Running `$action_state` in a future step will now return `yellow`

#### Multline strings
For multiline strings, you may use a delimeter with the following syntax.

```
{name}<<{delimeter}
{value}
{delimeter}
```

#### Example
In this example, we use `EOF` as a delimiter and set the `JSON_RESPONSE` environment variable to the value of the curl response.
```
steps:
- name: Set the value
id: step_one
run: |
echo 'JSON_RESPONSE<<EOF' >> $GITHUB_ENV
curl https://httpbin.org/json >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
```


### Adding a system path

`echo "{path}" >> $GITHUB_PATH`

Prepends a directory to the system `PATH` variable for all subsequent actions in the current job. The currently running action cannot access the new path variable.

#### Example

``` bash
echo "/path/to/dir" >> $GITHUB_PATH
```
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: About two-factor authentication
intro: 'Two-factor authentication, or 2FA, is an extra layer of security used when logging into websites or apps. With 2FA, you have to log in with your username and password and provide another form of authentication that only you know or have access to.'
intro: '{% data reusables.two_fa.about-2fa %} With 2FA, you have to log in with your username and password and provide another form of authentication that only you know or have access to.'
redirect_from:
- /articles/about-two-factor-authentication
versions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Inviting users to join your organization
intro: 'You can invite anyone to become a member of your organization using their {% data variables.product.product_name %} username or email address.'
permissions: 'Organization owners can invite users to join an organization.'
redirect_from:
- /articles/adding-or-inviting-members-to-a-team-in-an-organization/
- /articles/inviting-users-to-join-your-organization
Expand All @@ -11,9 +12,8 @@ versions:
{% tip %}

**Tips**:
- Only organization owners can invite users to join an organization. For more information, see "[Permission levels for an organization](/articles/permission-levels-for-an-organization)."
- If your organization has a paid per-user subscription, an unused license must be available before you can invite a new member to join the organization or reinstate a former organization member. For more information, see "[About per-user pricing](/articles/about-per-user-pricing)." {% data reusables.organizations.org-invite-expiration %}
- If your organization [requires members to use two-factor authentication](/articles/requiring-two-factor-authentication-in-your-organization), users you invite must [enable two-factor authentication](/articles/securing-your-account-with-two-factor-authentication-2fa) before they can accept the invitation.
- If your organization requires members to use two-factor authentication, users that you invite must enable two-factor authentication before accepting the invitation. For more information, see "[Requiring two-factor authentication in your organization](/github/setting-up-and-managing-organizations-and-teams/requiring-two-factor-authentication-in-your-organization)" and "[Securing your account with two-factor authentication (2FA)](/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa)."

{% endtip %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ versions:
enterprise-server: '*'
---

{% data reusables.two_fa.auth_methods_2fa %}
### About two-factor authentication for organizations

{% data reusables.two_fa.about-2fa %} You can require all {% if currentVersion == "free-pro-team@latest" %}members, outside collaborators, and billing managers{% else %}members and outside collaborators{% endif %} in your organization to enable two-factor authentication on {% data variables.product.product_name %}. For more information about two-factor authentication, see "[Securing your account with two-factor authentication (2FA)](/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa)."

### Requirements for enforcing two-factor authentication
{% if currentVersion == "free-pro-team@latest" %}

Before you can require {% if currentVersion == "free-pro-team@latest" %}organization members, outside collaborators, and billing managers{% else %}organization members and outside collaborators{% endif %} to use 2FA, you must [enable two-factor authentication](/articles/securing-your-account-with-two-factor-authentication-2fa/) for your own personal account.
You can also require two-factor authentication for organizations in an enterprise. For more information, see "[Enforcing security settings in your enterprise account](/github/setting-up-and-managing-your-enterprise-account/enforcing-security-settings-in-your-enterprise-account#requiring-two-factor-authentication-for-organizations-in-your-enterprise-account)."

{% endif %}

{% warning %}

Expand All @@ -24,7 +28,15 @@ Before you can require {% if currentVersion == "free-pro-team@latest" %}organiza

{% endwarning %}

Before you require use of two-factor authentication, we recommend notifying {% if currentVersion == "free-pro-team@latest" %}organization members, outside collaborators, and billing managers{% else %}organization members and outside collaborators{% endif %} and asking them to set up 2FA for their accounts. You can [see if members and outside collaborators already use 2FA](/articles/viewing-whether-users-in-your-organization-have-2fa-enabled) on your organization's People page.
{% data reusables.two_fa.auth_methods_2fa %}

### Prerequisites

Before you can require {% if currentVersion == "free-pro-team@latest" %}organization members, outside collaborators, and billing managers{% else %}organization members and outside collaborators{% endif %} to use two-factor authentication, you must enable two-factor authentication for your account on {% data variables.product.product_name %}. For more information, see "[Securing your account with two-factor authentication (2FA)](/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa)."

Before you require use of two-factor authentication, we recommend notifying {% if currentVersion == "free-pro-team@latest" %}organization members, outside collaborators, and billing managers{% else %}organization members and outside collaborators{% endif %} and asking them to set up 2FA for their accounts. You can see if members and outside collaborators already use 2FA. For more information, see "[Viewing whether users in your organization have 2FA enabled](/github/setting-up-and-managing-organizations-and-teams/viewing-whether-users-in-your-organization-have-2fa-enabled)."

### Requiring two-factor authentication in your organization

{% data reusables.profile.access_profile %}
{% data reusables.profile.access_org %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ versions:
{% topic_link_in_list /managing-your-enterprise-account %}
{% link_in_list /about-enterprise-accounts %}
{% link_in_list /viewing-the-subscription-and-usage-for-your-enterprise-account %}
{% link_in_list /managing-licenses-for-visual-studio-subscription-with-github-enterprise %}
{% topic_link_in_list /managing-users-in-your-enterprise-account %}
{% link_in_list /roles-for-an-enterprise-account %}
{% link_in_list /inviting-people-to-manage-your-enterprise-account %}
Expand Down
Loading