Update Branch #1
This file contains hidden or 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: Update Branch | |
on: | |
workflow_dispatch: | |
jobs: | |
update_branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure Git user | |
run: | | |
git config --global user.email "support@norsodikin.ltd" | |
git config --global user.name "ɴᴏʀ sᴏᴅɪᴋɪɴ" | |
- name: Get current branch name | |
id: branch_name | |
run: echo "BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV | |
- name: Create orphan branch | |
run: | | |
git checkout --orphan temp-branch | |
- name: Add all changes | |
run: | | |
git add -A | |
- name: Commit changes | |
run: | | |
COMMIT_MESSAGE=$(TZ=Asia/Jakarta date +"%Y-%m-%d %H:%M:%S") | |
git commit -m "$COMMIT_MESSAGE" | |
- name: Replace original branch | |
run: | | |
git branch -D ${{ env.BRANCH }} | |
git branch -m ${{ env.BRANCH }} | |
- name: Force push updated branch | |
run: | | |
git push --force origin ${{ env.BRANCH }} |