Tail 50m logs #2875
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: Tail 50m logs | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '50 * * * *' | |
permissions: | |
contents: write | |
jobs: | |
tail-logs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
domain: [ | |
'bac-lac.gc.ca', | |
'cas-satj.gc.ca', | |
'cer-rec.gc.ca', | |
'cse-cst.gc.ca', | |
'csc-scc.gc.ca', | |
'irb-cisr.gc.ca', | |
'nserc-crsng.gc.ca', | |
'nsira-ossnr.gc.ca', | |
'otc-cta.gc.ca', | |
'sac-isc.gc.ca', | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Tail logs for ${{ matrix.domain }} | |
uses: maxneuvians/tail-ct-log-action@main | |
env: | |
DOMAIN: ${{ matrix.domain }} | |
- name: Check for changes | |
id: git_diff | |
run: | | |
git fetch origin main | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "changes=changes" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit files | |
if: steps.git_diff.outputs.changes == 'changes' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Work bot" | |
git add -A | |
git commit -m "Adding ${{ matrix.domain }} logs `date '+%Y-%m-%d %H:%M:%S'`" -a | |
- name: Pull and push changes | |
if: steps.git_diff.outputs.changes == 'changes' | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_seconds: 10 | |
max_attempts: 3 | |
command: | | |
git pull --rebase origin main | |
git push origin main |