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

docs: Advise setting GITHUB_TOKEN to avoid rate limits #818

Open
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG

- feat: Add deletion of stack after destroy (remove flag)
- docs: Advise setting GITHUB_TOKEN to avoid rate limits

--

Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
stack-name: org-name/stack-name
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Avoid GitHub rate limits (see below)
```

This will check out the existing directory and run `pulumi preview`.
Expand All @@ -41,8 +42,8 @@ The action can be configured with the following arguments:
values are `up` (update), `refresh`, `destroy` and `preview`.

- `stack-name` (required) - The name of the stack that Pulumi will be operating
on. Use the fully quaified org-name/stack-name when operating on a stack outside
of your individual account.
on. Use the fully quaified org-name/stack-name when operating on a stack
outside of your individual account.

- `work-dir` (optional) - The location of your Pulumi files. Defaults to `./`.

Expand Down Expand Up @@ -105,8 +106,8 @@ The action can be configured with the following arguments:
`Pulumi.<stack-name>.yaml` file that you will need to add back to source
control as part of the action if you wish to perform any further tasks with
that stack.
- `remove` - (optional) Removes the target stack if all resources are
destroyed. Used only with `destroy` command.
- `remove` - (optional) Removes the target stack if all resources are destroyed.
Used only with `destroy` command.
- `pulumi-version` - (optional) Install a specific version of the Pulumi CLI.
Defaults to "^3"

Expand All @@ -115,6 +116,14 @@ By default, this action will try to authenticate Pulumi with the
`PULUMI_ACCESS_TOKEN` then you will need to specify an alternative backend via
the `cloud-url` argument.

If you are using any Pulumi plugins then you should also set the `GITHUB_TOKEN`
environment variable in order to avoid hitting GitHub rate limits. The easiest
way to do this is to set it to the automatically created
`${{ secrets.GITHUB_TOKEN }}`. (The GitHub docs provide more details regarding
[automatic token authentication](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)
and
[rate limits](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting).)

### Stack Outputs

[Stack outputs](https://www.pulumi.com/docs/intro/concepts/stack/#outputs) are
Expand Down Expand Up @@ -148,6 +157,7 @@ action, we would use code similar to the following:
id: pulumi
env:
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: up
cloud-url: gs://my-bucket
Expand Down