Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: ignore error flag #32

Open
spencerdcarlson opened this issue Jan 3, 2024 · 0 comments
Open

Feature Request: ignore error flag #32

spencerdcarlson opened this issue Jan 3, 2024 · 0 comments

Comments

@spencerdcarlson
Copy link

spencerdcarlson commented Jan 3, 2024

It would nice if there were a ignore_error option that could be set to true and default to false.

Use case: I want to execute kubectl delete job <job-name> and not fail if the job doesn't exist, so that in the next stage I can execute kubectl apply -f job.yaml

Here is my current workaround

- name: Delete Migration Job
  if: ${{ contains(fromJSON('["prod"]'), matrix.env) }}
  env:
    KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
  run: |
    set -e
    if [ ! -f "$HOME/.kube/config" ]; then
      if [ ! -z "${KUBE_CONFIG}" ]; then
        mkdir -p $HOME/.kube
        echo "$KUBE_CONFIG" | base64 -d > $HOME/.kube/config
      fi
    fi
    kubectl delete job accounts-migrate-database || true
- name: Run Database Migration Job
  if: ${{ contains(fromJSON('["prod"]'), matrix.env) }}
  uses: actions-hub/kubectl@master
  env:
    KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
  with:
    args: apply -f kube/job-db-migrate.yaml    
@spencerdcarlson spencerdcarlson changed the title Feature Request: ignore error Feature Request: ignore error flag Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant