Get github action url from bash script

Getting the github action job url from bash I have been trying to link rest testing framework pages to the connect github action job BUILD_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" printf "[github action]($BUILD_URL) :point_left: \n" >> test-result.md here is the example result page check the footer area. like image below full bash script, in case you want to generate the url from yml ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} further details

March 11, 2022 · 1 min · Özkan Pakdil

How to delete all files except one in bash

I have been testing jhipster and its jdl, nice thing you can prepare a jdl file and it will generate all dao and pojos and admin panels. jhipster is generating a lot of files and I wanted to delete them all except the jdl file itself, here is how ls -a | grep -v test.jdl | xargs rm -rf

October 10, 2021 · 1 min · Özkan Pakdil

How to call Atlassian Cloud Jira Rest API

I needed to call atlassian jira custom fields rest service and show them as good as possible. I know jira admin panel has a page for it. I am just trying to list them in a seperate page. First of al for easy development we can get json with this shell script. #!/bin/bash USER='YOUREMAIL:TOKEN' # get it from https://id.atlassian.com/manage/api-tokens URL='https://test1q2w.atlassian.net/rest/api/3/field' curl --request GET --url $URL --user $USER --header 'Accept: application/json' > test.json Now we have test.json to load and show. also it needs a little bit extra. therefore we just write var data= in to the file and load it like ...

September 4, 2019 · 1 min · Özkan Pakdil

How to solve ripe.net access denied

I have been using whois for a long time(around 10 years). and if you are sending this whois queries from same ip and higher then expected. you will start seeing ripe.net access denied results. one solution is restart your adsl modem. or start using another ip. and my solution is TOR :) sudo apt install tor torsocks you will need to configure torify check https://www.linux.com/blog/beginners-guide-tor-ubuntu torify whois 25.166.194.172 and I did not wanted to run in my server. therefore amazon free instance and a micro service https://github.com/ozkanpakdil/CommandRunner did the trick. ...

May 23, 2018 · 1 min · Özkan Pakdil

Delete files in linux best way

Let say you have bunch(5 millions) of small files in your linux in some folder. when you try to delete them can be very tricky. Everybody knows rm -rf /tmp/somefolder but if you run this on a server which already has internet load it may freeze it. and make it stop serving pages. So what are the options. first and easiest way find /tmp/somefolder/ -type f -mtime +30 | xargs rm -f this also can freeze or eat a lot of resources to run. ...

January 13, 2018 · 2 min · Özkan Pakdil