Skip to content

Tail 0m logs

Tail 0m logs #2799

Workflow file for this run

name: Tail 0m logs
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
permissions:
contents: write
jobs:
tail-logs:
runs-on: ubuntu-latest
strategy:
matrix:
domain: [
'cannor.gc.ca',
'gg.ca',
'grainscanada.gc.ca',
'hc-sc.gc.ca',
'ised-isde.gc.ca',
'ncc-ccn.gc.ca',
'ppsc-sppc.gc.ca',
'scc-csc.ca',
'sshrc-crsh.gc.ca',
'tsb.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