Skip to content

Tail 20m logs

Tail 20m logs #3118

Workflow file for this run

name: Tail 20m logs
on:
workflow_dispatch:
schedule:
- cron: '20 * * * *'
permissions:
contents: write
jobs:
tail-logs:
runs-on: ubuntu-latest
strategy:
matrix:
domain: [
'dfo-mpo.gc.ca',
'fintrac-canafe.gc.ca',
'ic.gc.ca',
'infrastructure.gc.ca',
'inspection.gc.ca',
'justice.gc.ca',
'rcaanc-cirnac.gc.ca',
'sshrc-crsh.gc.ca',
'tpsgc-pwgsc.gc.ca',
'veterans.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