Giter Site home page Giter Site logo

c33t33 / gh-action-push-workflow-last-job-status-to-azure-queue-3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from c33t33/gh-action-push-workflow-last-job-status-to-azure-queue-2

1.0 0.0 0.0 8 KB

This action sends last job's in the github workflow status, along with some metadata, to an Azure Queue.

License: MIT License

Go 95.43% Dockerfile 4.57%

gh-action-push-workflow-last-job-status-to-azure-queue-3's Introduction

Push workflow last job status to Azure Queue action

This action sends last job's in the github workflow status, along with some metadata, to an Azure Queue.

Inputs

STORAGE_ACCOUNT_NAME

Required Storage account name where the Azure queue is located.

STORAGE_ACCOUNT_KEY

Required Storage account key in order to authenticate to.

QUEUE_NAME

Required Name of the queue where the messages are going to be sent to.

JOB_STATUS

Required Exit status of last job.

Outputs

data-sent

The json data sent to the Azure Queue.

Example usage

uses: amongil/[email protected]
with:
  STORAGE_ACCOUNT_NAME: mystorageaccount
  STORAGE_ACCOUNT_KEY: ${{ secrets.AZURE_ACTION_STORAGE_ACCOUNT_KEY}}
  QUEUE_NAME: myqueue
  JOB_STATUS: ${{ job.status }}

Example data sent

{
   "Workflow":"myworkflow",
   "RunID":"60849633",
   "RunNumber":"14",
   "Actor":"amongil",
   "Repository":"amongil/github-action-poc",
   "EventName":"push",
   "EventPath":"/github/workflow/event.json",
   "Sha":"c2f56fb797480f470d4a3e1a564de4c6583f0481",
   "Ref":"refs/heads/master",
   "HeadRef":"",
   "BaseRef":"",
   "JobStatus":"Success"
}

Testing

Testing is done manually authenticating through local auth file. Be careful as you might incur in costs by testing.

For testing, simply run the following command:

go test

Tests will, in the given subscription:

  • Create a storage account
  • Retrieve the storage account key
  • Create a queue
  • Send a predefined message to the queue
  • Pop the queue and check that the received message equals to the one sent before

Example output of the go test command:

2020/03/21 15:54:26 creating resource group 'gh-action-push-result-to-azure-queue-aenog' on location: northeurope
2020/03/21 15:54:29 Creating storage account 'ghactionpushresultnrwwn1'
2020/03/21 15:54:49 Creating queue 'ghactionpushresulto56z4s'
2020/03/21 15:54:50 Added message "My Test Message" to the queue
2020/03/21 15:54:50 Deleting 0: {My Test Message}
PASS
2020/03/21 15:54:50 Deleting  resource group 'gh-action-push-result-to-azure-queue-aenog'
ok  	amongil/gh-action-push-result-to-azure-queue	26.210s

gh-action-push-workflow-last-job-status-to-azure-queue-3's People

Contributors

amongil avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.