GitLab CI/CD: How do I generate a change log between pipeline runs? I'm currently using Gitlab CI/CD combined with Fastlane on our build machine to perform nightly builds of an iOS app, and push those builds to TestFlight on completion. So far, so good. However, I've been asked to generate a change log of the new commits that have gone into each night's build.

Is it possible to get not just the CI_COMMIT_SHA of the current pipeline run, but also the SHA of the previous commit that the pipeline last ran for? That way, I could generate a change log of what's new in the current pipeline run? After searching the docs on Gitlab.com, I'm coming up empty so far.

As part of the pipeline, we also generate a build manifest that includes the current commit SHAs used for the build, and save that as an artifact. So, if it was possible to download the most recent artifacts, I could also maybe just look at that manifest, but again, I'm not seeing a way to do that either.
Note: the answer is rather speculative, based on docs only, I didn't actually use GitLab pipelines yet.
You may be able to use the Pipelines API. More specifically you could get a pipeline's variables:

Get variables of a pipeline
GET /projects/:id/pipelines/:pipeline_id/variables

Attribute Type            Required    Description
id            integer/string  yes         The ID or URL-encoded path of the project owned by the authenticated user
pipeline_id   integer         yes         The ID of a pipeline

Example of response
[
  {
    &quot;key&quot;: &quot;RUN_NIGHTLY_BUILD&quot;,
    &quot;variable_type&quot;: &quot;env_var&quot;,
    &quot;value&quot;: &quot;true&quot;
  },
  {
    &quot;key&quot;: &quot;foo&quot;,
    &quot;value&quot;: &quot;bar&quot;
  }
]


I'm suspecting that in the response you'd find the variables shown in a pipeline creation response example, which include these which could be of interest to you:

  &quot;id&quot;: 61,
  &quot;sha&quot;: &quot;384c444e840a515b23f21915ee5766b87068a70d&quot;,

  &quot;before_sha&quot;: &quot;0000000000000000000000000000000000000000&quot;,


I'm uncertain if the before_sha for the current pipeline is what you're looking for, if not you'd just get the sha for the previous pipeline ID, which you could derive from the current pipeline ID (via the CI_PIPELINE_ID environment variable, see Predefined environment variables). I'm assuming that the pipeline IDs are consecutive.