This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
✨ GithubActionsによるtemplateのアップデート #1
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: "Reflesh Template" | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
schedule: | |
- cron: "28 0 * * 3" | |
jobs: | |
PullAndFix: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set current datetime as env variable | |
env: | |
TZ: "Asia/Tokyo" | |
run: echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV | |
- name: Get Hash | |
run: echo "HASH=$(git rev-parse)" >> $GITHUB_ENV | |
- name: Pull | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git remote add template https://github.com/UniPro-tech/NextBlogComplateStarter.git | |
git branch template/master_${{ env.HASH }} | |
git pull template master:template/master_${{ env.HASH }} | |
PR: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Hash | |
run: echo "HASH=$(git rev-parse)" >> $GITHUB_ENV | |
- name: Create pull request | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: fix/hoge_${{ env.HASH }} | |
destination_branch: main | |
pr_title: Update template | |
pr_label: dependencies | |
github_token: ${{ secrets.GITHUB_TOKEN }} |