diff --git a/.github/workflows/trigger-gitlab-ci.yml b/.github/workflows/trigger-gitlab-ci.yml new file mode 100644 index 00000000000..431a47cd28f --- /dev/null +++ b/.github/workflows/trigger-gitlab-ci.yml @@ -0,0 +1,26 @@ +name: Trigger Gitlab CI/CD pipeline +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + trigger-gitlab-pipeline: + runs-on: ubuntu-latest + steps: + - name: trigger Gitlab pipeline + shell: bash + env: + #GITLAB_CI_TOKEN: ${{ secrets.GITLAB_CI_TOKEN }} + run: | + response=$(curl -s -X POST \ + --form token="$GITLAB_CI_TOKEN" \ + --form ref=ci-create-release \ + --form variables[API_CALL]="true" \ + --form variables[REPOSITORY_URL]="git@gitlab.com:etalab/data.gouv.fr/simple-scaffold.git" \ + --form variables[REPOSITORY_NAME]="simple-scaffold" \ + --form variables[RELEASE_VERSION]="1.0.0" \ + "https://gitlab.com/api/v4/projects/15835569/trigger/pipeline") + pipeline_status=$(echo "$response" | jq -r '.status') + pipeline_id=$(echo "$response" | jq -r '.id') + if [[ $pipeline_status != "created" ]]; then + exit 1 + fi + echo $pipeline_id