Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 17 additions & 40 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
contents: write
pull-requests: write
steps:
- name: Authenticate as semgrep-ide-plugins-release
id: generate-token
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
with:
app-id: ${{ vars.SEMGREP_IDE_PLUGINS_RELEASE_APP_ID }}
private-key: ${{ secrets.SEMGREP_IDE_PLUGINS_RELEASE_PRIVATE_KEY }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.3
with:
Expand All @@ -25,43 +31,14 @@ jobs:
SEMGREP_STATIC_VERSION: "release-${{ inputs.version }}"
run: |
echo "${SEMGREP_STATIC_VERSION}" > semgrep-version
- name: Commit and push
id: commit
env:
NEW_SEMGREP_VERSION: "${{ github.event.inputs.version }}"
GITHUB_ACTOR: "${{ github.actor }}"
GITHUB_RUN_ID: "${{ github.run_id }}"
GITHUB_RUN_ATTEMPT: "${{ github.run_attempt }}"
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
BRANCH="gha/bump-version-${NEW_SEMGREP_VERSION}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
SUBJECT="Bump semgrep to ${NEW_SEMGREP_VERSION}"
git checkout -b "${BRANCH}"
git add .
git commit -m "${SUBJECT}"
git push --set-upstream origin "${BRANCH}"
echo "branch=${BRANCH}" >> "${GITHUB_OUTPUT}"
echo "subject=${SUBJECT}" >> "${GITHUB_OUTPUT}"
- name: bump package patch version
run: |
npm version patch
git push
- name: Create PR
id: open-pr
env:
SOURCE: "${{ steps.commit.outputs.branch }}"
TARGET: "${{ github.event.repository.default_branch }}"
TITLE: "chore: Release Version ${{ inputs.version }}"
VERSION: "${{ inputs.version }}"
GH_TOKEN: "${{ github.token }}"
run: |
# check if the branch already has a pull request open
if gh pr list --head "${SOURCE}" | grep -vq "no pull requests"; then
# pull request already open
echo "pull request from SOURCE ${SOURCE} to TARGET ${TARGET} is already open";
echo "cancelling release"
exit 1
fi
# open new pull request with the body of from the local template.
gh pr create --title "${TITLE}" --body "Bump Semgrep Version to ${VERSION}" --base "${TARGET}" --head "${SOURCE}"
- name: Bump package patch version
run: npm version patch --no-git-tag-version
- name: Create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.generate-token.outputs.token }}
sign-commits: true
branch: gha/bump-version-${{ inputs.version }}-${{ github.run_id }}-${{ github.run_attempt }}
commit-message: "Bump semgrep to ${{ inputs.version }}"
title: "chore: Release Version ${{ inputs.version }}"
body: "Bump Semgrep Version to ${{ inputs.version }}"
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "semgrep",
"displayName": "Semgrep",
"description": "Security scans in a snap. Speedy SAST with a powerful rule registry for seamless detection and remediation of code vulnerabilities with each save.",
"version": "1.17.0",
"version": "1.17.1",
"engines": {
"vscode": "^1.86.0"
},
Expand Down
2 changes: 1 addition & 1 deletion semgrep-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release-1.159.0
release-1.161.0
Loading