Skip to content

Commit

Permalink
Fix typos and update GitHub actions versions
Browse files Browse the repository at this point in the history
  • Loading branch information
deining authored Aug 3, 2023
1 parent a526152 commit a67c241
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install staticcheck
Expand All @@ -27,7 +27,7 @@ jobs:
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Fmt
if: matrix.platform != 'windows-latest' # :(
run: "diff <(gofmt -d .) <(printf '')"
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# s3deploy

[![Project status: active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![GoDoc](https://godoc.org/github.com/bep/s3deploy?status.svg)](https://godoc.org/github.com/bep/s3deploy)
[![Test](https://github.com/bep/s3deploy/actions/workflows/test.yml/badge.svg)](https://github.com/bep/s3deploy/actions/workflows/test.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/bep/s3deploy)](https://goreportcard.com/report/github.com/bep/s3deploy)
Expand Down Expand Up @@ -91,7 +92,7 @@ The flags can be set in one of (in priority order):
1. As a flag, e.g. `s3deploy -path public/`
1. As an OS environment variable prefixed with `S3DEPLOY_`, e.g. `S3DEPLOY_PATH="public/"`.
1. As a key/value in `.s3deploy.yml`, e.g. `path: "public/"`
1. For `key` and `secret` resolution, the OS environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (and `AWS_SESSION_TOKEN`) will also be checked. This way you don't need to do any special to make it work with [AWS Vaule](https://github.com/99designs/aws-vault) and similar tools.
1. For `key` and `secret` resolution, the OS environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (and `AWS_SESSION_TOKEN`) will also be checked. This way you don't need to do any special to make it work with [AWS Vault](https://github.com/99designs/aws-vault) and similar tools.


Environment variable expressions in `.s3deploy.yml` on the form `${VAR}` will be expanded before it's parsed:
Expand Down Expand Up @@ -139,7 +140,7 @@ See https://docs.aws.amazon.com/sdk-for-go/api/aws/session/#hdr-Sessions_from_Sh

The `AWS SDK` will fall back to credentials from `~/.aws/credentials`.

If you set the `AWS_SDK_LOAD_CONFIG` enviroment variable, it will also load shared config from `~/.aws/config` where you can set the global `region` to use if not provided etc.
If you set the `AWS_SDK_LOAD_CONFIG` environment variable, it will also load shared config from `~/.aws/config` where you can set the global `region` to use if not provided etc.

## Example IAM Policy

Expand Down Expand Up @@ -213,7 +214,7 @@ Note that CloudFront allows [1,000 paths per month at no charge](https://aws.ama

## Background Information

If you're looking at `s3deploy` then you've probably already seen the [`aws s3 sync` command](http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) - this command has a sync-strategy that is not optimised for static sites, it compares the **timestamp** and **size** of your files to decide whether to upload the file.
If you're looking at `s3deploy` then you've probably already seen the [`aws s3 sync` command](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) - this command has a sync-strategy that is not optimised for static sites, it compares the **timestamp** and **size** of your files to decide whether to upload the file.

Because static-site generators can recreate **every** file (even if identical) the timestamp is updated and thus `aws s3 sync` will needlessly upload every single file. `s3deploy` on the other hand checks the etag hash to check for actual changes, and uses that instead.

Expand Down
6 changes: 3 additions & 3 deletions hugoreleaser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = "s3deploy"
# which contains the string on the left, e.g.
# { "linux-64bit" = "linux-amd64" }.
#
# The common use case is to to preserve some backward compability on name changes,
# The common use case is to to preserve some backward compatibility on name changes,
# the example above is taken from Hugo.
# You can include any extension in the above to limit this to e.g. only .deb archives.
archive_alias_replacements = {}
Expand All @@ -20,7 +20,7 @@ archive_alias_replacements = {}
go_exe = "go"

# Build settings can be set on any of Project > Build > Goos > Goarch.
# Zero values (empty strings, 0 numbers) and nil slices/maps wil inherit values from the nearest non-zero value above for a key.
# Zero values (empty strings, 0 numbers) and nil slices/maps will inherit values from the nearest non-zero value above for a key.
# Empty slices and maps will stay empty (e.g. `env = []`)
[build_settings]
binary = "s3deploy"
Expand Down Expand Up @@ -63,7 +63,7 @@ archive_alias_replacements = {}
# Will fall back to the default if not set.
template_filename = ""

# Collapse relases with < 10 changes below one title.
# Collapse releases with < 10 changes below one title.
short_threshold = 10
short_title = "What's Changed"

Expand Down
2 changes: 1 addition & 1 deletion lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (cfg *Config) init() error {
}

if cfg.AccessKey == "" && cfg.SecretKey == "" {
// The AWS SDK will fall back to other ways of finding credentials, so we cannot throw ane error here; it will eventually fail.
// The AWS SDK will fall back to other ways of finding credentials, so we cannot throw an error here; it will eventually fail.
} else if cfg.AccessKey == "" || cfg.SecretKey == "" {
return errors.New("both AWS access key and secret key must be provided")
}
Expand Down
2 changes: 1 addition & 1 deletion watch_testscripts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

# I use "run tests on save" in my editor.
# Unfortantly, changes to text files does not trigger this. Hence this workaround.
# Unfortunately, changes to text files does not trigger this. Hence this workaround.
while true; do find testscripts -type f -name "*.txt" | entr -pd touch main_test.go; done

0 comments on commit a67c241

Please sign in to comment.