Skip to content

Refactor/cleanup

Refactor/cleanup #6

Workflow file for this run

name: CI Pipeline for Pull Requests
on:
pull_request:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
jobs:
# Auto-generate date job to update _config.yml
auto-gen-date:
name: Update ci_last_modified_date in _config.yml
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
persist-credentials: true
fetch-depth: 0
- name: Set date
id: set_date
run: |
date_value=$(date +'%Y-%m-%d')
echo "date_yyyy_mm_dd=$date_value" >> $GITHUB_ENV
echo "date=$date_value" >> $GITHUB_OUTPUT
- name: Update _config.yml
uses: mikefarah/yq@master
with:
cmd: yq -i '.ci_last_modified_date = "${{ steps.set_date.outputs.date }}"' _config.yml
- name: Commit and Push
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "ci: Auto-update date to ${{ steps.set_date.outputs.date }}"
file_pattern: "_config.yml"