New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

azdo-cancel-previous-builds

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azdo-cancel-previous-builds

Cancels all previous Azure Devops builds. Meant to be run from an Azure Devops pipeline

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

azdo-cancel-previous-builds

This is a command-line script that will cancel any previous in-progress Azure Devops builds.

How it works

By using the environment variables set within Azure Devops pipelines, this script will query the Azure Devops API to find previous runs of this pipeline on the same branch.

It will then cancel these builds.

Usage

From your Azure Devops pipeline, include a script task to include Node (v10 or up), and then execute the script:

- task: NodeTool@0
  displayName: Install node
  inputs:
    versionSpec: 17.x
- script: npx azdo-cancel-previous-builds

Development

First, run npm install to install dependencies.

Second, this script depends on certain environment variables to be present. To simulate this locally, create a file called .env and fill this with:

SYSTEM_ACCESSTOKEN=<your azure devops private access token>
SYSTEM_TEAMFOUNDATIONCOLLECTIONURI=https://dev.azure.com/<your organization>
SYSTEM_TEAMPROJECT=<your project>
SYSTEM_DEFINITIONID=<a build definition id>
BUILD_BUILDID=<a build id>
BUILD_SOURCEBRANCH=<a branch, e.g. refs/heads/master>

To run the script once, enter:

npm run start

To run the script on every change, enter:

npm run dev

Keywords

FAQs

Package last updated on 10 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc