generated from sapphiredev/sapphire-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.43 KB
/
migrate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Migrate
on:
workflow_dispatch:
jobs:
Migrate:
name: Migrate
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Run Migration
run: yarn migrate
- name: Commit any changes and create a pull request
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add .;
if git diff-index --quiet HEAD --; then
echo "No changes to commit, exiting with code 0"
exit 0;
else
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git";
git config --local user.email "${GITHUB_EMAIL}";
git config --local user.name "${GITHUB_USER}";
git checkout -b migration/$(date +%F-%H-%M);
git commit -sam "refactor: migrate to new version";
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
gh pr create -t "refactor: migrate to new version" -b "*bleep bloop* I migrated the docs" -B main;
fi