feat: Add configurable ddb delete protection (#633) #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: End to end validation | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
validation: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-region: ${{ secrets.PIPELINE_AWS_REGION }} | |
role-to-assume: arn:aws:iam::${{ secrets.PIPELINE_AWS_ACCOUNT_ID }}:role/${{ secrets.PIPELINE_ROLE }} | |
role-session-name: github-action | |
- name: Validate | |
run: | | |
executionId=$(aws codepipeline start-pipeline-execution --name ${{ secrets.PIPELINE_NAME }} --region ${{ secrets.PIPELINE_AWS_REGION }} --query "pipelineExecutionId" --output text) | |
sleep 60 | |
while true; do | |
status=$(aws codepipeline get-pipeline-execution --pipeline-name ${{ secrets.PIPELINE_NAME }} --region ${{ secrets.PIPELINE_AWS_REGION }} --pipeline-execution-id $executionId --query "pipelineExecution.status" --output text) | |
echo "Pipeline status: $status" | |
if [[ "$status" == "Failed" ]]; then | |
echo "Pipeline failed." | |
exit 1 | |
fi | |
if [[ "$status" != "InProgress" ]]; then | |
break | |
fi | |
sleep 30 | |
done |