6 image: alpine:latest # Use the latest version of Alpine Linux docker image
12 - 'which ssh-agent || (apk update && apk add curl openssh-client git grep)'
13 - eval $(ssh-agent -s)
14 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
17 - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
18 - chmod 644 ~/.ssh/known_hosts
24 - git config --global user.name "curben-bot"
25 - git config --global user.email "3048979-curben-bot@users.noreply.gitlab.com"
30 # Generate successful status badge
32 - sh utils/badge.sh "success"
33 - git add .gitlab/status.svg
34 # Only commit when diff exists https://stackoverflow.com/a/8123841
35 - git diff-index --quiet HEAD || git commit -m "Success pipeline"
37 - ssh -T git@gitlab.com
38 - git remote set-url origin git@gitlab.com:curben/urlhaus-filter.git
39 - git push origin master
42 # Only trigger through schedule job and "Run pipeline" in master branch
43 - if: '$CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web")'
46 # Upload working folder as a job artifact
56 - 'which ssh-agent || (apk update && apk add curl openssh-client git grep)'
57 - eval $(ssh-agent -s)
58 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
61 - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
62 - chmod 644 ~/.ssh/known_hosts
66 - git config --global user.name "curben-bot"
67 - git config --global user.email "3048979-curben-bot@users.noreply.gitlab.com"
70 - sh utils/badge.sh "failed"
71 - git add .gitlab/status.svg
72 - git diff-index --quiet HEAD || git commit -m "Failed pipeline"
73 - ssh -T git@gitlab.com
74 - git remote set-url origin git@gitlab.com:curben/urlhaus-filter.git
75 - git push origin master
78 - if: '$CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web")'
79 # Run this job only when preceding jobs failed
83 - template: Security/Secret-Detection.gitlab-ci.yml