Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses TF_BUILD in vendors.json #116

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Uses TF_BUILD in vendors.json #116

merged 3 commits into from
Oct 4, 2023

Conversation

jessehouwing
Copy link
Contributor

@jessehouwing jessehouwing commented Oct 2, 2023

See: https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml

TF_BUILD - Set to True if the script is being run by a build task.

This variable is agent-scoped, and can be used as an environment variable in a script and as a parameter in a build task, but not as part of the build number or as a version control tag.

BUILD_REASON - The event that caused the build to run.

  • PullRequest: The build was triggered by a Git branch policy that requires a build.

That's a better variable to use to detect whether this build is related to a pull request.
@jrdodds
Copy link

jrdodds commented Oct 3, 2023

From a comment in another PR, it seems this is the more correct approach (versus #115).

@sibiraj-s
Copy link
Collaborator

sibiraj-s commented Oct 3, 2023

Thank you @jessehouwing . Can you add/fix tests as well? here https://github.com/watson/ci-info/blob/master/test.js#L126

Copy link
Collaborator

@sibiraj-s sibiraj-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes Looks good.

Will merge and publish by tomorrow once tests are fixed

@jessehouwing
Copy link
Contributor Author

jessehouwing commented Oct 3, 2023 via email

@jrdodds
Copy link

jrdodds commented Oct 3, 2023

It seems like the setup and teardown of the environment variables in the 'Azure Pipelines - PR' and 'Azure Pipelines - Not PR' tests needs to be updated. Looks straight-forward.

@jessehouwing
Copy link
Contributor Author

Also tested in actual Azure Pipelines Build and PR:

Starting: CmdLine
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.212.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/cdbbdb6f-d565-4658-a9db-477a3e230853.sh
Cloning into 'ci-info'...
Switched to a new branch 'patch-2'
branch 'patch-2' set up to track 'origin/patch-2'.

> ci-info@3.8.0 prepare
> husky install

husky - Git hooks installed

added 259 packages, and audited 260 packages in 12s

114 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
The name of the CI server is: Azure Pipelines
Is this a pull request?: true
Finishing: CmdLine

Copy link
Collaborator

@sibiraj-s sibiraj-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks 🎉

@sibiraj-s sibiraj-s merged commit 5ea8d85 into watson:master Oct 4, 2023
7 checks passed
@sibiraj-s
Copy link
Collaborator

Published in v3.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants