anchor.diff:  export GITHUB_RELEASE_ACCESS_KEY='xxx'
   ```
   
  -## Hooks on Windows
  +## Step hooks on Windows
   
   Agents running Windows require hook files to have either:
   
  
positive.code:       <td style="white-space: nowrap"><code>pre-exit</code></td>
        <td style="white-space: nowrap">Agent, Repository, Plugin</td>
        <td>Runs before the job finishes. Useful for performing cleanup tasks.</td></tr>
      <tr>
        <td style="white-space: nowrap"><code>agent-shutdown</code></td>
        <td style="white-space: nowrap">Agent</td>
        <td>Runs when each agent shuts down, and prints output only to the agent log. Useful for performing cleanup tasks for the entire agent, outside of the job lifecycle.</td></tr>
    </tbody>
  </table>
  
  ## Creating hook scripts
  
  Hooks are shell scripts you can use to run commands and export environment variables.
  Hooks have access to all the standard [Buildkite environment variables](/docs/pipelines/environment-variables).
  
  Hooks are copied to `$TMPDIR` directory and *sourced* by the default shell on the Agent that is running the build, which has a few implications:
  
  * `$BASH_SOURCE` contains the location the hook is sourced from
  * `$0` contains the location of the copy of the script that is running from `$TMPDIR`
  * the shebang line of the hook script has no effect
  
  To write hooks in another programming language, you need to call them from within the shell script, and explicitly pass any Buildkite environment variables you need to the script when you call it.
  
  The following is an example of a custom `environment` hook which exports a GitHub API key for the pipeline’s release build step:
  
  ```bash
  set -eu
  
negative.code:     <tr>
        <td style="white-space: nowrap"><code>environment</code></td>
        <td style="white-space: nowrap">Agent, Plugin</td>
        <td>Runs before all other hooks. Useful for <a href="/docs/pipelines/secrets#storing-secrets-in-environment-hooks">exposing secret keys</a>.</td></tr>
      <tr>
        <td style="white-space: nowrap"><code>pre-checkout</code></td>
        <td style="white-space: nowrap">Agent, Plugin</td>
  