Merge pull request #49 from embulk/dependabot-actions #14
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: Sync master to main | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
diff: | |
runs-on: ubuntu-latest | |
outputs: | |
hash-master: ${{ steps.hash-master.outputs.hash-master }} | |
hash-main: ${{ steps.hash-main.outputs.hash-main }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- id: hash-master | |
name: Hash the master branch | |
run: | | |
hash_master=$( git rev-parse origin/master ) | |
echo "$hash_master" | |
echo "hash-master=$hash_master" >> $GITHUB_OUTPUT | |
- id: hash-main | |
name: Hash the main branch | |
run: | | |
hash_main=$( git rev-parse origin/main ) | |
echo "$hash_main" | |
echo "hash-main=$hash_main" >> $GITHUB_OUTPUT | |
sync: | |
needs: diff | |
if: needs.diff.outputs.hash-master != needs.diff.outputs.hash-main | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Checkout master | |
run: git checkout master | |
- name: Sync master to main | |
run: git push origin master:main |