-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: explorer web: modify web-release to open a PR
- Loading branch information
Showing
1 changed file
with
30 additions
and
2 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 |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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 |