initial: add template CI for irs_pusher #5
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: IRS Pusher | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
commit: | |
name: Massal Scanner | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout Latest | |
uses: actions/checkout@v3 | |
- name: Set Up Python Latest | |
uses: actions/setup-python@v3 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Fetch last commit | |
shell: bash | |
run: | | |
echo "latestcommit=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
- name: Update Package Python | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
pip install logging | |
pip install yaml | |
- name: Integration Repository & Starting Scanner | |
shell: bash | |
run: | | |
git clone https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com/nodexemperor/irs --depth=1 | |
cp config.yaml irs/.irs/ | |
cd irs | |
echo "irslatestcommit=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
./irs-massal.py | |
git clone https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com/nodexemperor/irs_output | |
- name: Updating Commit To irs_output | |
shell: bash | |
run: | | |
cd irs_output | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
date="$(date)" | |
git add . | |
git commit --amend -am "synchronize: ${date} | |
IRS commit: ${{ env.irslatestcommit }} | |
Builder commit: ${{ env.latestcommit }}" -s | |
git push -f || echo "No changes to commit" |