Skip to content

Commit

Permalink
[temp] automate auth-spa
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Jan 18, 2024
1 parent 6079baa commit 46a6a58
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/asgardeo-auth-spa-version-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 🌝 Nightly Version Bump

on:
pull_request:
branches: [ master ]
workflow_dispatch:

env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
BOT_USERNAME: ${{ secrets.RELEASE_BOT_USER_NAME }}
BOT_EMAIL: ${{ secrets.RELEASE_BOT_EMAIL }}
BASE_BRANCH: 'main'

jobs:
bump-version:
runs-on: ubuntu-latest

steps:
- name: 🌟 Set up Git
run: |
git config user.name ${{ env.BOT_USERNAME }}}
git config user.email ${{ env.BOT_EMAIL }}}
- name: ⬇️ Checkout code
id: checkout
uses: actions/checkout@v2
with:
token: ${{ env.GH_TOKEN }}
fetch-depth: 0

- name: 🏷️ Set branch name
id: set-branch-name
run: |
base_branch=${{ env.BASE_BRANCH }}
version_bump_branch="asgardeo-auth-spa-version-bump/$base_branch"
echo "Setting branch name to: $version_bump_branch"
echo "VERSION_BUMP_BRANCH=${version_bump_branch}" >> $GITHUB_ENV
- name: πŸš€ Create version bump branch
id: create-branch
run: |
echo "Checking out a new branch: $VERSION_BUMP_BRANCH"
git checkout -b "$VERSION_BUMP_BRANCH"
git push origin "$VERSION_BUMP_BRANCH"
- name: πŸ“Š Get the latest `@asgardeo/auth-spa` release version
id: get-latest-auth-spa-version
run: |
latest_release=$(curl -s https://api.github.com/repos/asgardeo/asgardeo-auth-spa-sdk/releases/latest | jq -r '.tag_name')
echo "::set-output name=version::${latest_release}"
tree
- name: πŸŽ‰ Create pull request
id: create-pr
run: |
echo "VERSION_BUMP_BRANCH: $VERSION_BUMP_BRANCH"
echo "Creating pull request from $base_branch to $VERSION_BUMP_BRANCH"
gh pr create --base $base_branch --head $VERSION_BUMP_BRANCH --title "[Nightly Version Bump] [GitHub Action] Update package versions" --body "Bump versions"

0 comments on commit 46a6a58

Please sign in to comment.