Skip to content

upload-package

upload-package #28

Workflow file for this run

name: upload-package
on:
repository_dispatch:
types: [upload-package]
jobs:
upload-package:
runs-on: ubuntu-20.04
outputs:
kosli_cli_version: ${{ steps.upload-package.outputs.kosli_cli_version }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.KOSLI_REPORTER_SOURCES_AWS_ACCOUNT_ID }}:role/${{ github.event.repository.name }}
aws-region: ${{ secrets.KOSLI_REPORTER_SOURCES_AWS_REGION }}
role-duration-seconds: 900
role-session-name: ${{ github.event.repository.name }}
- name: Upload Evidence Reporter lambda package
id: upload-package
env:
TAG: ${{ github.event.client_payload.kosli_cli_tag }}
run: |
KOSLI_CLI_VERSION="${TAG:1}"
echo "kosli_cli_version=$KOSLI_CLI_VERSION" >> $GITHUB_OUTPUT
curl -Lo kosli_${KOSLI_CLI_VERSION}_linux_amd64.tar.gz https://github.com/kosli-dev/cli/releases/download/${TAG}/kosli_${KOSLI_CLI_VERSION}_linux_amd64.tar.gz
tar -xf kosli_${KOSLI_CLI_VERSION}_linux_amd64.tar.gz -C . && rm kosli_${KOSLI_CLI_VERSION}_linux_amd64.tar.gz
zip -j evidence_reporter_${KOSLI_CLI_VERSION}.zip deployment/* kosli
aws s3 cp evidence_reporter_${KOSLI_CLI_VERSION}.zip s3://${{ secrets.KOSLI_REPORTER_SOURCES_S3_NAME }}/evidence_reporter_${TAG}.zip
deploy-evidence-reporters:
runs-on: ubuntu-20.04
needs: [upload-package]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.KOSLI_REPORTER_REPO_ACCESS_TOKEN }}
repository: kosli-dev/terraform-evidence-reporter
event-type: deploy-evidence-reporter
client-payload: '{"kosli_cli_version": "${{ needs.upload-package.outputs.kosli_cli_version }}"}'