Skip to content

Merge pull request #1009 from SwedbankPay/dependabot/npm_and_yarn/mul… #467

Merge pull request #1009 from SwedbankPay/dependabot/npm_and_yarn/mul…

Merge pull request #1009 from SwedbankPay/dependabot/npm_and_yarn/mul… #467

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@v2
with:
inlineScript: |
az storage blob delete-batch -s "\$web" --pattern ${{ needs.branch.outputs.branchname }}/** --account-name ${{ steps.variables.outputs.AZURE_ACCOUNT_STAGE }}