Skip to content

Commit

Permalink
add setup-oss (#14)
Browse files Browse the repository at this point in the history
* Create action.yml

* Create README.md

* Update README.md
  • Loading branch information
Shinji-IkariG authored Aug 20, 2024
1 parent b434478 commit 7d056cb
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
26 changes: 26 additions & 0 deletions actions/setup-oss/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Setup OSS Environment

This action installs ossutil and configures the OSS environment for further operations.

## Inputs

### `oss-id`

**Required** OSS access key ID.

### `oss-secret`

**Required** OSS access key secret.

### `oss-endpoint`

**Required** OSS endpoint.

## Example usage

```yaml
uses: vesoft-inc/.github/actions/setup-oss@master
with:
oss-id: ${{ secrets.OSS_ID }}
oss-secret: ${{ secrets.OSS_SECRET }}
oss-endpoint: ${{ secrets.OSS_ENDPOINT }}
28 changes: 28 additions & 0 deletions actions/setup-oss/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Setup OSS Environment'
description: 'Install ossutil and configure OSS credentials'
inputs:
oss-id:
description: 'OSS access key ID'
required: true
oss-secret:
description: 'OSS access key secret'
required: true
oss-endpoint:
description: 'OSS endpoint'
required: true

runs:
using: "composite"
steps:
- name: Install ossutil
run: |
if ! command -v ossutil &> /dev/null || ! command -v ossutil64 &> /dev/null
then
(command -v sudo &> /dev/null && curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash) || curl https://gosspublic.alicdn.com/ossutil/install.sh | bash
fi
shell: bash

- name: Configure OSS
run: |
ossutil64 config -e ${{ inputs.oss-endpoint }} -i ${{ inputs.oss-id }} -k ${{ inputs.oss-secret }} -L CH
shell: bash

0 comments on commit 7d056cb

Please sign in to comment.