Skip to content

Get modules official #6

Get modules official

Get modules official #6

#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Get modules official
on:
workflow_dispatch:
jobs:
official:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
repository: RROrg/rp-modules
token: ${{ secrets.RRORG }}
path: rp-modules
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Get official modules
run: |
cd rp-modules
. ./getOfficial.sh
- name: Check and Push
run: |
cd rp-modules
git pull
status=$(git status -s | grep -E 'official' | awk '{printf " %s", $2}')
if [ -n "${status}" ]; then
git add ${status}
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)"
git push -f
fi