Skip to content

Bump aws-actions/configure-aws-credentials from 3 to 4 #192

Bump aws-actions/configure-aws-credentials from 3 to 4

Bump aws-actions/configure-aws-credentials from 3 to 4 #192

Workflow file for this run

# https://github.com/hashicorp/setup-terraform
# https://www.terraform.io/docs/github-actions/setup-terraform.html
name: terraform
on:
pull_request:
paths: [ 'terraform/**', '.github/workflows/terraform.yml' ]
push:
# If at least one path matches a pattern in the paths filter, the workflow runs.
paths: [ 'terraform/**','.github/workflows/terraform.yml' ]
branches: [ main ]
jobs:
build:
if: " ! contains(github.event.head_commit.message, 'skip ci') "
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # run only on main
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
# align with terraform/versions.tf
terraform_version: "~> 1.3"
- name: Cache Terraform workdir
uses: actions/cache@v3.3.2
with:
path: ./terraform/.terraform
key: ${{ runner.os }}-terraform-1.0.x
restore-keys: ${{ runner.os }}-terraform-
- name: Run ShellCheck on appctl script
uses: ludeeus/action-shellcheck@master
# You can pass any supported ShellCheck option or flag with the SHELLCHECK_OPTS env key in the job definition.
# env:
# SHELLCHECK_OPTS: -e SC2059 -e SC2034 -e SC1090
with:
scandir: './terraform/files'
# https://github.com/ludeeus/action-shellcheck#minimum-severity-of-errors-to-consider-error-warning-info-style
severity: error
- name: Test appctl application control script
working-directory: ./terraform/files
run: |
echo >.env_config
./appctl.sh help
rm -f .env_config
- name: Build with Terraform
working-directory: ./terraform
run: |
terraform version
terraform init -backend=false
terraform fmt -check
terraform validate -no-color
- name: Publish Action Event
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # run only on main
run: |
aws sns publish --topic-arn $TOPIC_ARN --message "{\"action\":\"update\",\"workflow\":\"$GITHUB_WORKFLOW\"}" \
--message-attributes "GITHUB_SHA={DataType=String,StringValue=\"$GITHUB_SHA\"}, GITHUB_RUN_ID={DataType=String,StringValue=\"$GITHUB_RUN_ID\"}"
env:
TOPIC_ARN: ${{ secrets.TOPIC_ARN }}
- name: Send Kafka Publish Event with Docker
id: send-kafka-pub-event-playground # becomes $GITHUB_ACTION
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # run only on main
run: |
docker run -e KAFKA_PRODUCER_TOPIC_URL="${{secrets.KAFKA_PRODUCER_TOPIC_URL}}" -e KAFKA_PRODUCER_API_SECRET="${{secrets.KAFKA_PRODUCER_API_SECRET}}" ghcr.io/tillkuhn/rubin:latest \
-ce -key "$GITHUB_REPOSITORY/$GITHUB_WORKFLOW/$GITHUB_JOB" -header "producer=rubin/cli latest" \
-source "urn:ci:$GITHUB_REPOSITORY/$GITHUB_WORKFLOW/$GITHUB_JOB" \
-type "net.timafe.event.ci.published.v1" -subject "${GITHUB_REPOSITORY}-infra" \
-record "{\"action\":\"$GITHUB_ACTION\",\"actor\":\"$GITHUB_ACTOR\",\"commit\":\"$GITHUB_SHA\",\"run_url\":\"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"version\":\"${GITHUB_REF#refs/*/}\"}"