Skip to content

Commit 6e2e7e6

Browse files
authored
Merge pull request #7 from badsyntax/update-docs
Update docs
2 parents 2b031d9 + 1928a6f commit 6e2e7e6

File tree

6 files changed

+52
-35
lines changed

6 files changed

+52
-35
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [master]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [master]
2020
schedule:
2121
- cron: '42 5 * * 5'
2222

@@ -32,39 +32,39 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
35+
language: ['javascript']
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v2
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v1
5757

58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
6060

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
6464

65-
#- run: |
66-
# make bootstrap
67-
# make release
65+
#- run: |
66+
# make bootstrap
67+
# make release
6868

69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v1

.github/workflows/sync-s3.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
id: update-stack
3333
with:
3434
githubToken: ${{ secrets.GITHUB_TOKEN }}
35-
stackName: 'richardwillis-github-action-example-cloudformation-stack'
35+
stackName: 'badsyntax-github-action-example-aws-s3'
3636
template: './cloudformation/s3bucket-example.yml'
3737
applyChangeSet: ${{ github.event_name != 'repository_dispatch' }}
3838
awsRegion: 'us-east-1'
39-
parameters: 'S3BucketName=richardwillis.info-example-bucket-us-east-1&S3AllowedOrigins=https://richardwillis.info'
39+
parameters: 'S3BucketName=badsyntax-github-action-example-aws-s3-us-east-1&S3AllowedOrigins=https://richardwillis.info'
4040

4141
- uses: ./
4242
name: Sync HTML files to S3

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,21 @@ jobs:
7676
S3SyncedHTMLFiles: ${{ steps.sync-html-s3.outputs.S3SyncedFiles }}
7777
```
7878
79-
## Related Projects
79+
## Action Inputs
80+
81+
| key | description | example |
82+
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
83+
| `bucket` | The name of the S3 bucket | `example-bucket-us-east-1` |
84+
| `action` | The action to perform. Accepted values: `sync` or `clean` | `sync` |
85+
| `srcDir` | Source directory of local files to sync (if using the sync action) | `./src` |
86+
| `filesGlob` | Glob pattern for source files to sync to S3 (if using the sync action) | `**/*.html` |
87+
| `awsRegion` | The AWS region | `us-east-1` |
88+
| `cacheControl` | Cache-control headers | `public,max-age=31536000,immutable` |
89+
| `prefix` (optional) | The prefix for the uploaded object | `custom/folder` |
90+
| `stripExtensionGlob` (optional) | Glob pattern to strip extension (if using the sync action) | `**/**.html` |
91+
| `acl` (optional) | Access control list (options: `authenticated-read, aws-exec-read, bucket-owner-full-control, bucket-owner-read, private, public-read, public-read-write`) | `private` |
92+
93+
## Related GitHub Actions
8094

8195
- [github-action-aws-cloudfront](https://github.com/badsyntax/github-action-aws-cloudfront)
8296
- [github-action-aws-cloudformation](https://github.com/badsyntax/github-action-aws-cloudformation)

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ inputs:
3838
required: false
3939
default: ''
4040
description: '"authenticated-read" | "aws-exec-read" | "bucket-owner-full-control" | "bucket-owner-read" | "private" | "public-read" | "public-read-write"'
41+
outputs:
42+
S3SyncedFiles:
43+
description: 'A comma separated list of objects keys for files synced to S3. For example: file1,folder1/file2'
4144
runs:
4245
using: 'node16'
4346
main: 'dist/index.js'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"type": "module",
88
"scripts": {
99
"build": "tsc -p tsconfig.build.json",
10-
"format": "prettier --write '**/*.ts'",
11-
"format-check": "prettier --check '**/*.ts'",
10+
"format": "prettier --write '**/*.{ts,json,svg,md,yml}'",
11+
"format-check": "prettier --check '**/*.{ts,json,svg,md,yml}'",
1212
"lint": "eslint src/**/*.ts",
1313
"package": "ncc build lib/main.js --source-map --license licenses.txt",
1414
"test": "NODE_OPTIONS=--experimental-vm-modules jest"

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ INPUT_BUCKET="richardwillis.info-example-bucket-us-east-1" \
88
INPUT_CACHECONTROL="public,max-age=31536000,immutable" \
99
GITHUB_EVENT_NAME="pull_request" \
1010
GITHUB_ACTION="synchronize" \
11-
GITHUB_REPOSITORY="badsyntax/github-action-aws-cloudformation" \
11+
GITHUB_REPOSITORY="badsyntax/github-action-aws-s3" \
1212
GITHUB_WORKSPACE=$(pwd) \
1313
node lib/main.js

0 commit comments

Comments
 (0)