fix naming #1
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
on: | |
push: | |
branches: | |
- main | |
- master | |
release: | |
types: [ created ] | |
name: on-creating-new-tag | |
jobs: | |
send-pull-requests: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Get production version from tag | |
id: get_version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Checkout to other repo | |
uses: actions/checkout@v3 | |
with: | |
repository: curvefi/curve-js | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Send pull-request to curve-js | |
run: | | |
TAG=${{ env.RELEASE_VERSION }} | |
ORG="curvefi" | |
CURRENT_REPOSITORY="$ORG/deposit-and-stake-zap" | |
REPOSITORY="$ORG/curve-js" | |
FOLDER="bin/$REPOSITORY" | |
BRANCH_NAME="deployment-$CURRENT_REPOSITORY-$TAG" | |
# Setup the committers identity. | |
git config user.email "[email protected]" | |
git config user.name "Curvefi" | |
# Create a new feature branch for the changes. | |
git checkout -b $BRANCH_NAME | |
# Store the PAT in a file that can be accessed by the GitHub CLI. | |
echo "${{ secrets.ACCESS_TOKEN }}" > token.txt | |
# Create an empty commit for PR | |
git commit --allow-empty -m "deployment from $CURRENT_REPOSITORY - $TAG" | |
git push -u origin $BRANCH_NAME | |
# Authorize GitHub CLI for the current repository and | |
# create a pull-requests containing the updates. | |
gh auth login --with-token < token.txt | |
gh pr create \ | |
--body "Link to release: https://github.com/$CURRENT_REPOSITORY/releases/tag/$TAG" \ | |
--title "Deployment from $CURRENT_REPOSITORY - $TAG" \ | |
--head "$BRANCH_NAME" \ | |
--base "master" |