empty workflows #149717
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: empty workflows | |
on: | |
# | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
schedule: | |
#- cron: '*/10 * * * *' | |
- cron: '*/5 * * * *' | |
#defaults: | |
# run: | |
# working-directory: wrdir | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
#- name: step-1 | |
- id: step1 | |
run: | | |
output=$(python main.py) | |
output="${output//'%'/'%25'}" | |
output="${output//$'\n'/'%0A'}" | |
output="${output//$'\r'/'%0D'}" | |
echo "production=${output}" >> $GITHUB_OUTPUT | |
#run: echo ${{ steps.vars.outputs.production }} | |
#- name: Print 0 | |
# if: ${{ steps.vars.outputs.production == 0 }} | |
# run: echo "${{ steps.vars.outputs.production }}" | |
- name: Update Files | |
if: ${{ steps.step1.outputs.production == 1 }} | |
run: | | |
git add . | |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
git commit -am "Update Files" | |
git push | |
- name: Empty Commit | |
if: ${{ steps.step1.outputs.production == 1 }} | |
run: | | |
git add . | |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
git commit --allow-empty -m "Empty-Commit" | |
git push origin main | |
- name: Do Nothing | |
if: ${{ steps.step1.outputs.production == 0 }} | |
run: echo "${{ steps.step1.outputs.production }}" |