Skip to content

Issue while cleaning up the new instance #5

Open
@subhojit-axl

Description

@subhojit-axl

We are using this action to setup feature instances when a developer creates pull request. We have another GitHub action that is supposed to delete the feature instance when the pull request is merged.

name: Do cleanup

on:
  pull_request:
    types: [ closed ]

jobs:
  merge_job:
    # this job will only run if the PR has been merged
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    container: axelerant/platformsh-cli:latest
    env:
      ENV_NAME: platform
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Terminate instance
        run: |
          platform project:set-remote ${PLATFORM_PROJECT_ID}
          platform environment:deactivate ${GITHUB_REF_NAME} --delete-branch
        env:
          PLATFORMSH_CLI_TOKEN: ${{ secrets.PLATFORMSH_CLI_TOKEN }}

GITHUB_REF_NAME is the branch name to which the pull request is merged, not the pull request's branch name. Due to this it fails to delete the feature instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions