apiops
apiops copied to clipboard
Publisher Github Workflow no longer passes down COMMIT_ID
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.
- "commit_id" is meant to be an output parameter, not an environment variable. So it should it be set to "$GITHUB_OUTPUT" instead of "$GITHUB_ENV".
- Docs:
- Setting an "environment variable: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable
- Setting an "output parameter": https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-output-parameter
- GH Discusion about the difference: https://github.com/orgs/community/discussions/55294
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.
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.
I ran into same issue and had to change it to GITHUB_OUTPUT . With this change it worked as expected.
@waelkdouh This should have been addressed by #780. I think this can be closed.