Skip to content

Commit

Permalink
update kics internal release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cx-ruiaraujo committed Oct 25, 2024
1 parent 198a127 commit 29890d7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 45 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release-kics-cxone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: release-kics-cxone
on:
release:
types:
- published
jobs:
create-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Git credentials
run: |
git config --global user.name "KICSBot"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global url."https://${{ secrets.CHECKMARXDEV_GIT_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Clone internal repository
run: |
cd ..
git clone https://github.com/CheckmarxDev/${{ secrets.CHECKMARXDEV_KICS_RELEASER }}.git
- name: Create new branch for release ${{ github.event.release.name }}
run: |
cd ../${{ secrets.CHECKMARXDEV_KICS_RELEASER }}
git checkout --orphan ${{ github.event.release.name }}
find . -mindepth 1 \( -not -path './.*' -not -name 'README.md' -o -name '.gitignore' \) -delete
- name: Copy queries to new branch
run: |
mkdir -p ../${{ secrets.CHECKMARXDEV_KICS_RELEASER }}/kics-queries
rsync -av --exclude='*/test/*' --exclude='common/*' ./assets/queries/ ../${{ secrets.CHECKMARXDEV_KICS_RELEASER }}/kics-queries/
- name: Modify circleci configuration
run: |
sed -i 's/BRANCH_NAME_TEMPLATE_TO_REPLACE/${{ github.event.release.name }}/g' ../${{ secrets.CHECKMARXDEV_KICS_RELEASER }}/.circleci/config.yml
- name: Push branch
run: |
cd ../${{ secrets.CHECKMARXDEV_KICS_RELEASER }}
git add .
git commit -m "AUTO: Add queries from release ${{ github.event.release.name }} to ${{ secrets.CHECKMARXDEV_KICS_RELEASER }}"
git push origin ${{ github.event.release.name }}
45 changes: 0 additions & 45 deletions .github/workflows/release-kics-queries-repo-branch.yaml

This file was deleted.

0 comments on commit 29890d7

Please sign in to comment.