Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "test migration rename""""""""" #10
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
name: Rename Migrations | |
on: | |
pull_request: | |
types: | |
- closed | |
paths: | |
- 'backend/src/db/migrations/**' | |
jobs: | |
rename: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get list of newly added files in migration folder | |
run: git diff --name-status HEAD^ HEAD backend/src/db/migrations | grep '^A' | cut -f2 | xargs -n1 basename > added_files.txt | |
- name: Script to rename migrations | |
run: python .github/resources/rename_migration_files.py | |
- name: Commit and push changes | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add ./backend/src/db/migrations | |
git commit -m "chore: renamed new migration files to latest timestamp (gh-action)" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'chore: renamed new migration files to latest UTC(gh-action)' | |
title: 'GH Action: rename new migration file timestamp' | |
branch: main |