Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
328 stars 193 forks source link

Publisher Github Workflow no longer passes down COMMIT_ID #696

Open DSom20 opened 1 month ago

DSom20 commented 1 month ago

Release version

v6.0.1.3

Describe the bug

Despite the GH Workflow "Run Publisher" using the "...With-Commit-ID" job instead of the "...Without-Commit-ID" job, the "COMMIT_ID" input value doesn't get passed down to the called "Run Publisher With Environment" worklow.

Presumably was introduced here: https://github.com/Azure/apiops/pull/580/files#diff-7bedf9a275d5f664d80b7b9f3909dce3cacd392fc2265b1aee92c12380ab3d24:~:text=run%3A%20echo%20%22commit_id%3D%24%7BGITHUB_SHA%7D%22%20%3E%3E%20%24GITHUB_ENV.

Expected behavior

"COMMIT_ID" should be successfully passed down from the callee workflow run-publisher.yml's "Push-Changes-To-APIM-Dev-With-Commit-ID" job down to the called run-publisher-with-env.yaml workflow.

Actual behavior

"COMMIT_ID" is always empty in the called run-publisher-with-env.yaml workflow.

Reproduction Steps

Run the tools/github_workflows/run-publisher-with-env.yaml workflow in a project using the out-of-the-box "get-commit" job.

Add a log to either the "Push-Changes-To-APIM-Dev-With-Commit-ID" job or the called run-publisher-with-env.yaml workflow to try to see the COMMIT_ID value --> observe it is empty. So only the "...without Commit ID" jobs will ever run in that called workflow.

github-actions[bot] commented 1 month ago
  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.
martin2176 commented 3 weeks ago

Image

I ran into same issue and had to change it to GITHUB_OUTPUT . With this change it worked as expected.