From 6e25a552d3e252035cf2761840202c25ff371475 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Fri, 4 Nov 2022 12:14:55 -0400 Subject: [PATCH] enable feature branch api-schema test (#12550) - enable schema upload to s3 bucket for feature branch - add workflow to delete schema from s3 bucket when feature branch is deleted Signed-off-by: Hao Liu --- .github/workflows/feature_branch_deletion.yml | 24 +++++++++++++++++++ .github/workflows/upload_schema.yml | 1 + 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/feature_branch_deletion.yml diff --git a/.github/workflows/feature_branch_deletion.yml b/.github/workflows/feature_branch_deletion.yml new file mode 100644 index 0000000000..c2a3bdc785 --- /dev/null +++ b/.github/workflows/feature_branch_deletion.yml @@ -0,0 +1,24 @@ +--- +name: Feature branch deletion cleanup +on: + delete: + branches: + - feature_** +jobs: + push: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Delete API Schema + env: + AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} + AWS_REGION: 'us-east-1' + run: | + ansible localhost -c local, -m command -a "{{ ansible_python_interpreter + ' -m pip install boto3'}}" + ansible localhost -c local -m aws_s3 \ + -a "bucket=awx-public-ci-files object=${GITHUB_REF##*/}/schema.json mode=delete permission=public-read" + + diff --git a/.github/workflows/upload_schema.yml b/.github/workflows/upload_schema.yml index a9a4420f8f..8f258dd7c1 100644 --- a/.github/workflows/upload_schema.yml +++ b/.github/workflows/upload_schema.yml @@ -5,6 +5,7 @@ on: branches: - devel - release_** + - feature_** jobs: push: runs-on: ubuntu-latest