Skip to content

Commit

Permalink
ci: explorer web: modify web-release to open a PR
Browse files Browse the repository at this point in the history
  • Loading branch information
fariss committed Nov 26, 2024
1 parent 20909c1 commit 15b0b55
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/web-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
build-and-release:
needs: run-tests
runs-on: ubuntu-latest
permissions:
contents: write # required to create a branch
pull-requests: write # required to open a Pull Request
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -69,11 +72,36 @@ jobs:
run: ls -t capa-explorer-web-v*.zip | tail -n +4 | xargs -r rm --
working-directory: web/explorer/releases

- name: Commit and push release
- name: Create Pull Request
run: |
# create a new branch
git config --local user.email "[email protected]"
git config --local user.name "Capa Bot"
BRANCH_NAME="release/web-v${{ github.event.inputs.version }}"
git checkout -b $BRANCH_NAME
# add and commit changes
git add -f web/explorer/releases/${{ env.RELEASE_NAME }}.zip web/explorer/releases/CHANGELOG.md
git add -u web/explorer/releases/
git commit -m ":robot: explorer web: add release ${{ env.RELEASE_NAME }}"
git push
# push the branch
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: ":package: add new Explorer Web v${{ github.event.inputs.version }}"
body: |
This PR adds a new capa Explorer Web release v${{ github.event.inputs.version }}.
Release details:
- Name: ${{ env.RELEASE_NAME }}
- SHA256: ${{ env.RELEASE_SHA256 }}
This PR was automatically created by the web release workflow.
branch: release/web-v${{ github.event.inputs.version }}
base: master
labels: release
delete-branch: true

0 comments on commit 15b0b55

Please sign in to comment.