-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update kics internal release workflow
- Loading branch information
1 parent
198a127
commit 29890d7
Showing
2 changed files
with
44 additions
and
45 deletions.
There are no files selected for viewing
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
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 }} |
This file was deleted.
Oops, something went wrong.