Skip to content

Commit b040f42

Browse files
committed
update
1 parent 80739d1 commit b040f42

36 files changed

Lines changed: 492 additions & 836 deletions
File renamed without changes.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Sync Directory to S3
2+
description: Uploads a local directory to an S3 bucket with optional prefix and cleanup.
3+
4+
inputs:
5+
aws_access_key:
6+
description: AWS access key ID
7+
required: true
8+
aws_secret_key:
9+
description: AWS secret access key
10+
required: true
11+
aws_region:
12+
description: AWS region (e.g. us-east-1)
13+
required: true
14+
bucket_name:
15+
description: Name of the S3 bucket
16+
required: true
17+
source_dir:
18+
description: Local directory to sync
19+
required: true
20+
bucket_prefix:
21+
description: Optional path prefix in the S3 bucket
22+
required: false
23+
default: ""
24+
25+
runs:
26+
using: composite
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Configure AWS credentials
32+
uses: aws-actions/configure-aws-credentials@v2
33+
with:
34+
aws-access-key-id: ${{ inputs.aws_access_key }}
35+
aws-secret-access-key: ${{ inputs.aws_secret_key }}
36+
aws-region: ${{ inputs.aws_region }}
37+
38+
- name: Sync directory to S3
39+
shell: bash
40+
run: |
41+
DEST="s3://${{ inputs.bucket_name }}/${{ inputs.bucket_prefix }}"
42+
echo "Syncing ${{ inputs.source_dir }} → $DEST"
43+
aws s3 sync "${{ inputs.source_dir }}" "$DEST" \
44+
--delete \
45+
--exclude ".git/*" \
46+
--exclude ".github/*" \
47+
--exclude ".gitignore" \
48+
--exclude ".gitattributes"

.github/actions/is-commit/action.yml renamed to .github/actions/github-check-commit/action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ runs:
4040
echo "API Response:"
4141
echo "$response" | jq 2>/dev/null || echo "Failed to parse JSON response"
4242
43-
# Проверяем, является ли ответ массивом или объектом с сообщением об ошибке
4443
is_array=$(echo "$response" | jq 'if type=="array" then true else false end')
4544
if [ "$is_array" = "false" ]; then
46-
# Если это не массив, проверяем наличие сообщения об ошибке
4745
error=$(echo "$response" | jq -r '.message // empty')
4846
echo "::warning::API Response is not an array. Possible error: $error"
4947
@@ -63,7 +61,6 @@ runs:
6361
pr_numbers=$(echo "$search_result" | jq -r '.items[].number' | tr '\n' ',')
6462
pr_numbers=${pr_numbers%,} # Remove trailing comma
6563
echo "PR Numbers: $pr_numbers"
66-
# Используем переменную GITHUB_OUTPUT для установки выходных данных
6764
echo "pr_numbers=$pr_numbers" >> $GITHUB_OUTPUT
6865
echo "proceed=false" >> $GITHUB_OUTPUT
6966
exit 0
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: GolangCI Lint
2+
description: Run golangci-lint with custom Go version and directory
3+
4+
inputs:
5+
go_dir:
6+
description: "Directory with Go code"
7+
required: false
8+
default: "./"
9+
go_version:
10+
description: "Go version to use"
11+
required: false
12+
default: "1.24"
13+
golangci_lint_version:
14+
description: "Version of golangci-lint"
15+
required: false
16+
default: "v2.1.2"
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v4
26+
with:
27+
go-version: ${{ inputs.go_version }}
28+
29+
- name: Install golangci-lint
30+
shell: bash
31+
run: |
32+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
33+
| sh -s -- -b /usr/local/bin ${{ inputs.golangci_lint_version }}
34+
35+
- name: Run golangci-lint
36+
shell: bash
37+
working-directory: ${{ inputs.go_dir }}
38+
run: golangci-lint run --timeout=5m
File renamed without changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Terraform Format Check'
2+
description: 'Checks Terraform formatting with `terraform fmt -check -diff -recursive`.'
3+
4+
inputs:
5+
tf_dir:
6+
description: 'Path to the Terraform directory'
7+
required: false
8+
default: './'
9+
10+
tf_version:
11+
description: 'Terraform version to use'
12+
required: false
13+
default: '1.6.1'
14+
15+
runs:
16+
using: 'composite'
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Terraform
22+
uses: hashicorp/setup-terraform@v2
23+
with:
24+
terraform_version: ${{ inputs.tf_version }}
25+
26+
- name: Terraform fmt check
27+
shell: bash
28+
working-directory: ${{ inputs.tf_dir }}
29+
run: terraform fmt -check -diff -recursive
File renamed without changes.

.github/workflows/aws-s3-sync.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/aws-s3-sync2.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)