bump-version.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. on:
  2. workflow_dispatch:
  3. inputs:
  4. package:
  5. required: true
  6. type: string
  7. description: package name such as `sentry-arroyo`
  8. version:
  9. required: true
  10. type: string
  11. description: desired version such as `1.2.3`
  12. # disable all permissions -- we use the PAT's permissions instead
  13. permissions: {}
  14. jobs:
  15. bump-version:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
  19. with:
  20. token: ${{ secrets.BUMP_SENTRY_TOKEN }}
  21. - run: |
  22. set -euxo pipefail
  23. git checkout -b "bot/bump-version/$PACKAGE/$VERSION"
  24. re="$(sed 's/[_-]/[_-]/g' <<< "$PACKAGE")"
  25. sed -i "s/^$re==.*/$PACKAGE==$VERSION/g" -- requirements*.txt
  26. git \
  27. -c user.name=getsentry-bot \
  28. -c user.email='10587625+getsentry-bot@users.noreply.github.com' \
  29. commit \
  30. --all \
  31. --message "ref: bump $PACKAGE to $VERSION" \
  32. --message "Co-Authored-By: $SENDER <$SENDER_ID+$SENDER@users.noreply.github.com>"
  33. git push origin HEAD --quiet
  34. gh pr create --fill
  35. env:
  36. GH_TOKEN: ${{ secrets.BUMP_SENTRY_TOKEN }}
  37. PACKAGE: ${{ inputs.package }}
  38. VERSION: ${{ inputs.version }}
  39. SENDER: ${{ github.event.sender.login }}
  40. SENDER_ID: ${{ github.event.sender.id }}