diff --git a/.github/workflows/auto-delete-merged-branches.yml b/.github/workflows/auto-delete-merged-branches.yml deleted file mode 100644 index 09a7941..0000000 --- a/.github/workflows/auto-delete-merged-branches.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Automatically delete merged branches on PR merge - -on: - pull_request: - types: - - closed - -permissions: - contents: write - pull-requests: write - -jobs: - delete-merged-branches: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Delete Branch after merge (Except main) - run: | - BRANCH_NAME=${{ github.event.pull_request.head.ref }} - - # Prevent deletion of the main branch - if [ "${{ github.event.pull_request.merged }}" == "true" ] && [ "$BRANCH_NAME" != "main" ]; then - echo "Deleting merged branch: $BRANCH_NAME" - git push origin --delete $BRANCH_NAME - else - echo "Branch not deleted. Either it was not merged or it was 'main'." - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/cd-workflow.yaml b/.github/workflows/cd-workflow.yaml index 49b6f1b..7f4e3bf 100644 --- a/.github/workflows/cd-workflow.yaml +++ b/.github/workflows/cd-workflow.yaml @@ -2,7 +2,8 @@ name: Deploy backstage on: workflow_run: - workflows: ["CI Workflow"] + workflows: + - CI Workflow types: - completed @@ -26,16 +27,16 @@ jobs: - id: 'docker-buildx-setup' name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - id: 'auth' - name: 'Authenticate to Google Cloud' + - name: 'Authenticate to Google Cloud' + id: 'auth' uses: 'google-github-actions/auth@v2' with: create_credentials_file: true - token_format: access_token + token_format: "access_token" workload_identity_provider: 'projects/1006240973223/locations/global/workloadIdentityPools/deploy-backstage/providers/github-actions' service_account: 'deploy-backstage@code-idp.iam.gserviceaccount.com' - - id: 'login-gar' - name: "Login to GAR" + - name: "Login to GAR" + id: 'login-gar' uses: docker/login-action@v3 with: registry: europe-west10-docker.pkg.dev/code-idp/backstage-deploy diff --git a/.github/workflows/ci-workflow.yaml b/.github/workflows/ci-workflow.yaml index 28b72f5..077ff37 100644 --- a/.github/workflows/ci-workflow.yaml +++ b/.github/workflows/ci-workflow.yaml @@ -3,10 +3,10 @@ name: CI Workflow on: push: branches: - - '**' + - main pull_request: branches: - - '**' + - main jobs: setup_and_test: