Skip to content

Commit

Permalink
refactor: Shorten variables, use Bash conditional, and update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimMouse committed Jan 8, 2023
1 parent f5d5f14 commit 58a61a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ steps:
```

### Specific version
You can specify the version you want.
You can specify the version you want. By default, this action downloads the latest version.

```yaml
steps:
Expand All @@ -131,7 +131,7 @@ steps:
version: 0.14.0
```

### GitHub Token
### GitHub token
This action automatically uses a GitHub token in order to authenticate with GitHub API and avoid rate limiting. You can also specify your own read-only fine-grained personal access token.

```yaml
Expand Down
10 changes: 5 additions & 5 deletions scripts/download/Unix-like.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh
set -eu
if [ $RUNNER_OS = macOS ]; then restic_os=darwin; else restic_os=linux; fi
echo ::group::Downloading Restic $version for $restic_os
aria2c -x 16 $GITHUB_SERVER_URL/restic/restic/releases/download/v$version/restic_${version}_${restic_os}_amd64.bz2
bzip2 -d restic_${version}_${restic_os}_amd64.bz2
if [ $RUNNER_OS = macOS ]; then os=darwin; else os=linux; fi
echo ::group::Downloading Restic $version for $RUNNER_OS
aria2c -x 16 $GITHUB_SERVER_URL/restic/restic/releases/download/v$version/restic_${version}_${os}_amd64.bz2
bzip2 -d restic_${version}_${os}_amd64.bz2
mkdir Restic
mv restic_${version}_${restic_os}_amd64 Restic/restic
mv restic_${version}_${os}_amd64 Restic/restic
chmod +x Restic/restic
echo ::endgroup::
2 changes: 1 addition & 1 deletion scripts/version/Unix-like.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -eu
if [ $version == latest ]
if [[ $version == latest ]]
then
latest_version=$(gh api repos/restic/restic/releases/latest -q .tag_name)
echo version=${latest_version/v} >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 58a61a1

Please sign in to comment.