Skip to content

Commit

Permalink
update the script for plugon
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen Rumney committed Dec 9, 2021
1 parent d88991e commit eaa38ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
runs-on: ubuntu-latest

steps:


- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand All @@ -37,8 +35,3 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Updating plugin
run: scripts/update_plugin.sh
env:
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
26 changes: 18 additions & 8 deletions scripts/update_plugin.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
#!/usr/bin/env bash

echo "update plugin.yaml"
set -ex

sed -e "s/PLACEHOLDERVERSION/${GITHUB_REF##*/}/g" .github/plugin_template.yaml > plugin.yaml
function log() {
message=$1

echo `date +"%T"` $message
}

git fetch --all
log "Switching to master branch"
git checkout master
git pull
git config --global user.name "GitHub Actions Build"
git config --global user.email github-action@aquasec.com

log "Getting latest tags"
git fetch --tags
LATEST_TAG=`git describe --tag`

sed -e "s/PLACEHOLDERVERSION/${GITHUB_REF##*/}/g" .github/plugin_template.yaml > plugin.yaml

git checkout -b "plugin-update-${LATEST_TAG}"

git add plugin.yaml
git commit -m "GitHub Actions Build: Update plugin version" || true
git push --set-upstream origin HEAD:master || true
git commit -m "Updateing plugin to latest tag ${LATEST_TAG}" || true
git push --set-upstream origin "plugin-update-${LATEST_TAG}" || true

0 comments on commit eaa38ea

Please sign in to comment.