Skip to content

Merge pull request #912 from SwedbankPay/dependabot/github_actions/JS… #390

Merge pull request #912 from SwedbankPay/dependabot/github_actions/JS…

Merge pull request #912 from SwedbankPay/dependabot/github_actions/JS… #390

Workflow file for this run

name: Janitor
on:
push:
branches:
- "develop"
jobs:
branch:
name: Find branch name
runs-on: ubuntu-latest
outputs:
branchname: ${{ steps.branch.outputs.BRANCH_TO_DELETE }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Get branch name and delete merged feature branches
id: branch
run: ./.github/scripts/clean-merged-branches.sh
build:
needs: branch
name: Storage container cleanup
if: ${{ needs.branch.outputs.branchname }}
runs-on: ubuntu-latest
strategy:
matrix:
brand: ["payex", "swedbankpay"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
# Set brand specific variables
- name: Environment variables
id: variables
run: ./.github/scripts/variables.sh --brand ${{ matrix.brand }} --ref ${{ github.ref }}
- name: Azure Login
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS_STAGE }}
- name: Delete feature folders
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob delete-batch -s "\$web" --pattern ${{ needs.branch.outputs.branchname }}/** --account-name ${{ steps.variables.outputs.AZURE_ACCOUNT_STAGE }}