Merge pull request #179 from Checkmarx/feature/update-cli-1 #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Checkmarx One CLI GitHub Action | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
generate_release_notes: true | |
notify: | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Get latest relase notes | |
id: release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
body_release="$(gh api -H "Accept: application/vnd.github.v3+json" /repos/Checkmarx/ast-github-action/releases/latest | jq -r '.body' )" | |
body_release="${body_release//$'\n'/'%0A'}" | |
echo "::set-output name=body_release::$body_release" | |
- name: Converts Markdown to HTML | |
id: convert | |
uses: lifepal/[email protected] | |
with: | |
text: "${{ steps.release.outputs.body_release }}" | |
- name: Clean html | |
id: clean | |
run: | | |
clean="$(echo "${{ steps.convert.outputs.html }}" | awk '{gsub(/id=.[a-z]+/,"");print}' | tr -d '\n')" | |
echo "$clean" | |
echo "::set-output name=clean::$clean" | |
- name: Send a Notification | |
id: notify | |
uses: thechetantalwar/teams-notify@v2 | |
with: | |
teams_webhook_url: ${{ secrets.TEAMS_WEBHOOK_URI }} | |
message: "<h1>Checkmarx One Github Action ${{ github.ref_name }}</h1>${{ steps.clean.outputs.clean }}" |