alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Akka/Scala example source code file (github-tagging.sh)

This example Akka source code file (github-tagging.sh) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Akka and Scala source code examples by using tags.

All credit for the original source code belongs to akka.io; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Akka tags/keywords

add_tags, authorization, env, h, owner, post, pr_validator_gh_token, repo, rm_tags, x

The github-tagging.sh Akka example source code

#!/bin/sh

# tag an github issue with the given tag, api token is taken from env ($PR_VALIDATOR_GH_TOKEN)
# usage: ghtag ISSUE_NR OWNER REPO ADD_TAGS RM_TAGS
#
# ADD_TAGS should be json with tokens you want to add, as in: ["tested"]
# RM_TAGS should be a list of words, like "building bananas"
function ghtag {
  if [[ "$PR_VALIDATOR_GH_TOKEN" == "" ]]
  then
    echoerr "Env variable PR_VALIDATOR_GH_TOKEN was empty, unable to call github api!"
    exit 1;
  fi

  issue=$1
  owner=$2
  repo=$3
  add=$4
  remove=$5

  curl -s -H "Authorization: token $PR_VALIDATOR_GH_TOKEN" https://api.github.com/repos/$owner/$repo/issues/$issue/labels -X POST -d $add > /dev/null
  for d in $remove
  do
    curl -s -H "Authorization: token $PR_VALIDATOR_GH_TOKEN" https://api.github.com/repos/$owner/$repo/issues/$issue/labels/$d -X DELETE > /dev/null
  done
}

echoerr() { echo "$@" 1>&2; }

Other Akka source code examples

Here is a short list of links related to this Akka github-tagging.sh source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.