Skip to content

Commit 40084a8

Browse files
authored
cleanup: add descriptions, update auth-token usage (#56)
1 parent 7d784a8 commit 40084a8

File tree

11 files changed

+37
-30
lines changed

11 files changed

+37
-30
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
"use-pro": "true",
3030
}
3131
env:
32-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
32+
# intentially left `LOCALSTACK_API_KEY` as env here, to ensure the fallback still works for old version
33+
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
3334
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
3435

3536
- name: Run Version Test Against LocalStack
@@ -58,7 +59,7 @@ jobs:
5859
"use-pro": "true",
5960
}
6061
env:
61-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
62+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
6263
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
6364

6465
- name: Generate random pod name
@@ -80,14 +81,14 @@ jobs:
8081
"state-action": "save",
8182
}
8283
env:
83-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
84+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
8485
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
8586

8687
- name: Verify Cloud Pod
8788
run: |
8889
localstack pod list | grep ${{ steps.pod_name.outputs.name }}
8990
env:
90-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
91+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
9192

9293

9394
load-cloud-pod-test:
@@ -112,7 +113,7 @@ jobs:
112113
"state-action": "load"
113114
}
114115
env:
115-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
116+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
116117
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
117118

118119
- name: Verify loaded resources
@@ -125,7 +126,7 @@ jobs:
125126
- name: Clean up remote pod
126127
run: localstack pod delete ${{ needs.cloud-pods-save-test.outputs.pod-name }}
127128
env:
128-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
129+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
129130

130131

131132
- name: Verify successful cleanup of Cloud Pod
@@ -137,7 +138,7 @@ jobs:
137138
fi
138139
echo "Pod successfully deleted."
139140
env:
140-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
141+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
141142

142143

143144
local-state-save-test:
@@ -159,7 +160,7 @@ jobs:
159160
"use-pro": "true",
160161
}
161162
env:
162-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
163+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
163164
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
164165

165166
- name: Run AWS commands
@@ -178,7 +179,7 @@ jobs:
178179
"state-backend": "local",
179180
}
180181
env:
181-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
182+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
182183
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
183184

184185
local-state-load-test:
@@ -204,7 +205,7 @@ jobs:
204205
"state-backend": "local",
205206
}
206207
env:
207-
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
208+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
208209
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref_name }}
209210

210211
- name: Run AWS Commands

.github/workflows/ephemeral.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
"extension-auto-install": "localstack-extension-mailhog",
2727
}
2828
env:
29-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
29+
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
3030
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}
3131
PREVIEW_CMD: |-
3232
awslocal s3 mb s3://test-bucket
@@ -78,5 +78,5 @@ jobs:
7878
"state-action": "stop"
7979
}
8080
env:
81-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
81+
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
8282
GH_ACTION_VERSION: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref_name }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Harsh Mishra
3+
Copyright (c) 2022-2026 LocalStack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A GitHub Action to setup [LocalStack](https://github.com/localstack/localstack) on your GitHub Actions runner workflow by:
77

88
- Pulling a specific version of the LocalStack Docker Image into the GitHub Action runner.
9-
- Configuring the [LocalStack CLI](https://docs.localstack.cloud/get-started/#localstack-cli) to launch the Docker container with an optional API token for pro usage.
9+
- Configuring the [LocalStack CLI](https://docs.localstack.cloud/get-started/#localstack-cli) to launch the Docker container with an optional Auth Token for pro usage.
1010
- Installing [LocalStack AWS CLI](https://github.com/localstack/awscli-local), a thin wrapper around the `aws` command line interface for use with LocalStack to run integration tests over AWS services.
1111
- Export/import [LocalStack state](https://docs.localstack.cloud/user-guide/state-management/export-import-state/) as an artifact
1212
- Save/load [LocalStack Cloud Pods](https://docs.localstack.cloud/user-guide/state-management/cloud-pods/)
@@ -23,9 +23,9 @@ A GitHub Action to setup [LocalStack](https://github.com/localstack/localstack)
2323
image-tag: 'latest'
2424
install-awslocal: 'true'
2525
env:
26-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
26+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
2727
```
28-
> **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set if `use-pro` is set to `true`.
28+
> **NOTE**: The `LOCALSTACK_AUTH_TOKEN` environment variable is required to be set if `use-pro` is set to `true`.
2929
If the key is not found LocalStack by default falls back to the CE edition and displays a warning.
3030

3131
### Install only CLIs and startup later
@@ -43,7 +43,7 @@ If the key is not found LocalStack by default falls back to the CE edition and d
4343
with:
4444
image-tag: 'latest'
4545
env:
46-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
46+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
4747
```
4848

4949
### Save a state later on in the pipeline
@@ -56,9 +56,9 @@ If the key is not found LocalStack by default falls back to the CE edition and d
5656
state-action: save
5757
state-name: my-cloud-pod
5858
env:
59-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
59+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
6060
```
61-
> **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set to save/load LocalStack's state either as a Cloud Pod or as a file artifact.
61+
> **NOTE**: The `LOCALSTACK_AUTH_TOKEN` environment variable is required to be set to save/load LocalStack's state either as a Cloud Pod or as a file artifact.
6262

6363
### Load an already saved state
6464
```yml
@@ -70,11 +70,11 @@ If the key is not found LocalStack by default falls back to the CE edition and d
7070
state-action: load
7171
state-name: my-cloud-pod
7272
env:
73-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
73+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
7474
```
7575
> **NOTE**: To load a **local state** from a different GitHub Actions workflow, one must set the `WORKFLOW_ID` environment variable.
7676

77-
> **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set to **save/load** LocalStack's state either as a Cloud Pod or as a file artifact.
77+
> **NOTE**: The `LOCALSTACK_AUTH_TOKEN` environment variable is required to be set to **save/load** LocalStack's state either as a Cloud Pod or as a file artifact.
7878

7979
### Manage Application Previews (on an Ephemeral Instance)
8080
```yml
@@ -88,7 +88,7 @@ uses: LocalStack/setup-localstack@v0.2.3
8888
# Optional script/command to run
8989
preview-cmd: deploy.sh
9090
env:
91-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
91+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
9292

9393
...
9494

@@ -99,7 +99,7 @@ with:
9999
state-backend: ephemeral
100100
state-action: stop
101101
env:
102-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
102+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
103103
```
104104
105105
## Inputs
@@ -119,10 +119,10 @@ with:
119119
| `skip-ephemeral-stop` | Skip stopping LocalStack Ephemeral Instance | `false` |
120120
| `skip-startup` | Explicitly prevent LocalStack start up, only installs CLI(s). Recommended to manage state later on in the pipeline or start up an ephemeral instance. | `false` |
121121
| `skip-wait` | Skip waiting for LocalStack to start up | `false` |
122-
| `state-action` | Valid values are `load`, `save`, `start`, `stop`, `` (empty, don't manage state). Values `start`/`stop` only usable with app previews. | `` |
122+
| `state-action` | Valid values are `load`, `save`, `start`, `stop`, `''` (empty, don't manage state). Values `start`/`stop` only usable with app previews. | `''` |
123123
| `state-backend` | Either store the state of LocalStack locally, as a Cloud Pod or start an Ephemeral Instance. Valid values are `cloud-pods`, `ephemeral` or `local`. Use this option in unison with `state-action` to control behaviour. | `cloud-pods` |
124124
| `state-name` | Name of the state artifact (without extension) | `false` |
125-
| `use-pro` | Whether to use the Pro version of LocalStack (requires API key to be configured) | `false` |
125+
| `use-pro` | Whether to use the Pro version of LocalStack (requires Auth Token to be configured) | `false` |
126126

127127
## Example workflow
128128
```yml
@@ -147,7 +147,7 @@ jobs:
147147
state-action: load
148148
state-name: my-cloud-pod
149149
env:
150-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
150+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
151151
152152
- name: Run Tests against LocalStack
153153
run: |
@@ -162,7 +162,7 @@ jobs:
162162
state-action: save
163163
state-name: my-ls-state-artifact
164164
env:
165-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
165+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
166166
WORKFLOW_ID: ${{ env.MY_GOLDEN_LS_STATE }}
167167
```
168168

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ inputs:
1616
required: true
1717
default: 'true'
1818
use-pro:
19-
description: 'Whether to use LocalStack Pro (requires a valid API key)'
19+
description: 'Whether to use LocalStack Pro (requires a valid CI Auth Token)'
2020
required: false
2121
default: 'false'
2222
configuration:

cloud-pods/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: 'Save/Load a LocalStack Cloud Pod'
2+
description: 'Save or load a LocalStack Cloud Pod'
23

34
inputs:
45
name:

finish/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Finish CI Build
2+
description: Finish CI Build
23

34
inputs:
45
github-token:

local/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: 'Save/Load LocalStack state'
2+
description: 'Save or load LocalStack state'
23

34
inputs:
45
name:

prepare/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Start CI Build
2+
description: Start CI Build
23

34
inputs:
45
github-token:

startup/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: 'Start up Localstack'
2+
description: 'Starts up Localstack'
23

34
inputs:
45
image-tag:
@@ -10,7 +11,7 @@ inputs:
1011
required: true
1112
default: 'true'
1213
use-pro:
13-
description: 'Whether to use LocalStack Pro (requires a valid API key)'
14+
description: 'Whether to use LocalStack Pro (requires a valid CI Auth Token)'
1415
required: false
1516
default: 'false'
1617
configuration:
@@ -62,7 +63,7 @@ runs:
6263
run: |
6364
if [ "$USE_PRO" = true ]; then
6465
if [ "x$LOCALSTACK_AUTH_TOKEN" = "x" -o "x$LOCALSTACK_API_KEY" = "x" ]; then
65-
echo "WARNING: LocalStack API key not detected, please verify your configuration..."
66+
echo "WARNING: LocalStack Auth Token not detected, please verify your configuration..."
6667
fi
6768
CONFIGURATION="DNS_ADDRESS=127.0.0.1 ${CONFIGURATION}"
6869
IMAGE_NAME="${IMAGE_NAME:-localstack/localstack-pro:${IMAGE_TAG}}"

0 commit comments

Comments
 (0)